[jQuery] Re: Executing javascript that comes inside an AJAX response

2009-04-04 Thread Nehal
kjhgfdfsdf On Mar 15, 3:12 am, Foreigner wrote: > Hi, > I'm trying to use jQuery to get some HTML with Javascript usingAJAX. > My response gets inserted into the contentDiv element but my > javascript inside the response doesn't get executed as the > documentation says (http://docs.jquery.com/ >

[jQuery] Re: Executing javascript that comes inside an AJAX response

2009-03-27 Thread sveisvei
Hi, If its just an event(mouseover) you dont have to do this inline and shouldnt, just set up the eventlistener against the id/position in the dom. On Mar 27, 1:14 pm, Amit Shah wrote: > thanks mkmanning, > but i do not using jquery now, i using prototype now. > anyway i have moved the script

[jQuery] Re: Executing javascript that comes inside an AJAX response

2009-03-27 Thread Amit Shah
thanks mkmanning, but i do not using jquery now, i using prototype now. anyway i have moved the script to main page. will try another time. On Mar 27, 1:42 am, mkmanning wrote: > Did you try my suggestion? > -- > Put this div in you

[jQuery] Re: Executing javascript that comes inside an AJAX response

2009-03-26 Thread Saira Zaheer
http://tinyurl.com/dar2ld http://tinyurl.com/cvjkqa http://tinyurl.com/ae56nz On 3/26/09, James wrote: > > > What do you mean? Could you provide an example of the content of your > response and what you want to do with it? > > You cannot call a function from inside the response html data b

[jQuery] Re: Executing javascript that comes inside an AJAX response

2009-03-26 Thread mkmanning
Did you try my suggestion? -- Put this div in your main page: -- Put this script in your main page (essentially what you have already, fix the url for your server): $(do

[jQuery] Re: Executing javascript that comes inside an AJAX response

2009-03-26 Thread Amit Shah
oh god. i got a function sometesting() in the ajax response text ok? not in calling main page. it's in response html data from ajax. in response there is a table. in table there is a td and on td mouseover event i call that function to highlight some fields. now the function cam from response te

[jQuery] Re: Executing javascript that comes inside an AJAX response

2009-03-26 Thread James
What do you mean? Could you provide an example of the content of your response and what you want to do with it? You cannot call a function from inside the response html data before it reaches the browser. It has to reach the browser first because the browser does the Javascript work. If you want

[jQuery] Re: Executing javascript that comes inside an AJAX response

2009-03-26 Thread Amit Shah
you didn't get it. i mean the function written in response text. which has be evaluated. can be called only from the main script. not from inside the responsed html data. On Mar 24, 8:07 pm, mkmanning wrote: > If you're going to use jQuery, you have to be careful about writing > code that then

[jQuery] Re: Executing javascript that comes inside an AJAX response

2009-03-24 Thread mkmanning
If you're going to use jQuery, you have to be careful about writing code that then doesn't use jQuery. In this case, you're ajax call would have worked fine, if you had stuck with injecting the response into the DOM with jQuery, as it automatically evals scripts in a response with dataType of 'htm

[jQuery] Re: Executing javascript that comes inside an AJAX response

2009-03-24 Thread Amit Shah
it's not working. well eval(responseText); don't works. cells = divResult.getElementsByTagName("script"); alert(cells.length); for (var i = 0; i < cells.length; i++) { alert(cells[i].innerHTML

[jQuery] Re: Executing javascript that comes inside an AJAX response

2009-03-14 Thread NightWatchman
To execute javascript code returned by the server you need to use the javascript eval function on the string of script returned from the server. As far as I know changing the content of a div to a javascript block won't cause that javascript code to execute. I think you need to change: contentDi