[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread Jake
I'd suggest .live() still. Or maybe you could try eval() those JavaScript code after Ajax fetch and DOM manipulation complete manually? btw, do you check the page source using `view page source' or firebug's dom inspector? latter recommended. On Apr 15, 3:56 pm, Snef sne...@gmail.com wrote:

[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread András Csányi
2009/4/15 Snef sne...@gmail.com: When using $.ajax() i encounter some problems. With the ajax I'm calling a script that will return some html. When echoing the returned data, I can see that everything is returned including the javascript tags. When 'inserting' the returned data into a div

[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread András Csányi
2009/4/15 Snef sne...@gmail.com: I already tried it with the $(document).ready(function(){.}). No success. :( And through $.getJSON()? At night I can send you an string what is go through json into $(#foo).html(); András -- - - -- Csanyi Andras -- http://sayusi.hu -- Sayusi Ando --

[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread Snef
The 'problem' using .live() is that i need to have all the scripts loaded even when they are not used. I just wanted to have only the scripts related to that form. The check is either in 'view generated source' in FF and the dom inspector. I'm not sure about eval, sounds like evil ;) A simple

[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread Snef
Donny Kurnia schreef: Snef wrote: When using $.ajax() i encounter some problems. With the ajax I'm calling a script that will return some html. When echoing the returned data, I can see that everything is returned including the javascript tags. When 'inserting' the returned data

[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread Snef
Well a tip to all. When having problems, first give your pc a nice reboot ;) Suddenly it is working :S Don;t know why, but it is. Thanx for all support! Snef schreef: Donny Kurnia schreef: Snef wrote: When using $.ajax() i encounter some problems. With the ajax I'm calling a

[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread András Csányi
2009/4/15 Snef sne...@gmail.com: Well a tip to all. When having problems, first give your pc a nice reboot ;) Are you serious? :) Which OS do you have? Suddenly it is working :S Don;t know why, but it is. O_o -- - - -- Csanyi Andras -- http://sayusi.hu -- Sayusi Ando -- Bízzál

[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread Snef
I do not think it is due to $.ajax function. Even when using plain $ (#freediv).html(.) it won't work. (and I don't need json yet). András Csányi schreef: 2009/4/15 Snef sne...@gmail.com: I already tried it with the $(document).ready(function(){.}). No success. :( And through

[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread Snef
András Csányi schreef: 2009/4/15 Snef sne...@gmail.com: When using $.ajax() i encounter some problems. With the ajax I'm calling a script that will return some html. When echoing the returned data, I can see that everything is returned including the javascript tags. When

[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread Donny Kurnia
Snef wrote: When using $.ajax() i encounter some problems. With the ajax I'm calling a script that will return some html. When echoing the returned data, I can see that everything is returned including the javascript tags. When 'inserting' the returned data into a div on the screen, the

[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread Charlie Tomlinson
simple solution using your example that works Create a js file "test.js" containing : $('#freediv').html('h1 id="test"test/h1'); $("#test").click(function(){ alert("Bla"); }); I used an a tag in html to click to call the test.js file as follows: script type="text/_javascript_"

[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread Donny Kurnia
Snef wrote: Donny Kurnia schreef: Snef wrote: When using $.ajax() i encounter some problems. With the ajax I'm calling a script that will return some html. When echoing the returned data, I can see that everything is returned including the javascript tags. When 'inserting' the