Calling a jQuery function inside html return from an AJAX call?

If you want JavaScript tag evaluation, with html content, you should set the dataType option of the ajax call to "html.

If you want JavaScript tag evaluation, with html content, you should set the dataType option of the ajax call to "html": $. Ajax({ type: "GET", url: "yourPage. Htm", dataType: "html" }); Or dataType "script", if you want to load and execute a .

Js file: $. Ajax({ type: "GET", url: "test. Js", dataType: "script" }); more info here: Ajax/jQuery.ajax.

I had a similar problem where I wanted to add little jquery date pickers to a couple fields I was retrieving via ajax. Here is what I did to get around it... just quick and dirty. Instead of returning this whole block from my ajax call: other html I would return this (note the made up |x| separator) $(function() { $('input').

MyFunction('param'); }); |x| other html Then when I received the data back via ajax, I split the return value into 2 parts: the javascript to be executed, and the html to display: r = returnvalfromajax. Split("|x|"); document. GetElementById('whatever').

InnerHTML = r1; eval(r0).

Well, you can use jQuery load() function: docs.jquery.com/Ajax/load#urldatacallback As a callback you can define function which will be executed after loading new content example: $("#feeds"). Load("new_content. Html",, doSomething()); and in new_content.

Html you can define function doSomething()...

For ajax.net the endRequestHandler(sender, args) solution works fine though.

Have you tried Sys.WebForms. PageRequestManager. Add_endRequest method?

$(document). Ready(function() { Sys.WebForms. PageRequestManager.getInstance().

Add_endRequest(endRequestHandler); } ); function endRequestHandler(sender, args) { // whatever }.

2 He is not using ASP. NET! – Josh Stodola Aug 11 '09 at 21:01.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions