[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. >>> >>> Wh

[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('test');             $("#test").click(function(){                 alert("Bla");              }); I used an tag in html to click to call the test.js file as follows:
$(document).

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

2009-04-15 Thread András Csányi
2009/4/15 Snef : > > 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 Istenben és tar

[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 c

[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

[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

[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 : > > > > I already tried it with the $(document).ready(function(){.}). No > > success. :( > > And through $.getJ

[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 al

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

2009-04-15 Thread András Csányi
2009/4/15 Snef : > > 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 -- "Bízzál Iste

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

2009-04-15 Thread Snef
András Csányi schreef: > 2009/4/15 Snef : > > > > 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 'inserti

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

2009-04-15 Thread András Csányi
2009/4/15 Snef : > > 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 s

[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 wrote: > When using $.ajax()