Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Dynamic table using JScript

Reply
Thread Tools

Dynamic table using JScript

 
 
Al
Guest
Posts: n/a
 
      01-17-2004
Hi,
I am trying to add rows to a table dynamically, using JScript. Can I someone
explain, how to add events to the newly added cells/ rows? Following code
does not fire the onmousemove event.

Thanks in advance,
Alwin S.

newRow = tblResults.insertRow();
newCell = newRow.insertCell();
newCell.innerHTML = rsX("Title").Value;
newCell.onmousemove = "javascript:alert(1);";


 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      01-17-2004


Al wrote:

> I am trying to add rows to a table dynamically, using JScript. Can I someone
> explain, how to add events to the newly added cells/ rows? Following code
> does not fire the onmousemove event.



> newRow = tblResults.insertRow();
> newCell = newRow.insertCell();
> newCell.innerHTML = rsX("Title").Value;
> newCell.onmousemove = "javascript:alert(1);";


Not an ASP problem it seems. An event handler in client side JavaScript
is a function object so you need to use one of the ways the language
offers to create one, the most elegant being a function expression
newCell.onmousemove = function (evt) {
alert('...');
};
--

Martin Honnen
http://JavaScript.FAQTs.com/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hook JScript functions using IActiveScript using C++ Eran Javascript 1 12-31-2006 08:11 PM
What is Server-Side Jscript (not Jscript.NET)? Maxwell2006 ASP .Net 5 03-07-2006 05:28 AM
JScript.Net (JScript 7.0) is official documented language VK Javascript 4 01-12-2006 06:48 PM
Porting from JScript to JScript.Net - compiler error Jon Maz ASP .Net 4 09-09-2004 10:24 AM
Which to Learn: Javascript, Jscript, JScript.NET, ECMA 262 (3rd ed)? John Bentley Javascript 14 02-05-2004 06:14 PM



Advertisments