469,361 Members | 2,429 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,361 developers. It's quick & easy.

javascript within body in ajax

3
hi everybody,
i am using ajax in my page to get contents and load them in a 'div' inside my main page. everything works fine as long as the content is a normal html code. but if the content contains javascript then it is not executing. e.g. the javascript of my content is
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">alert('content');</script>
as i click a link to get this content, it is not executing.
does anybody hav the answer for my problem?? thanx in advance...
Sep 11 '07 #1
3 1107
dmjpro
2,476 2GB
hi everybody,
i am using ajax in my page to get contents and load them in a 'div' inside my main page. everything works fine as long as the content is a normal html code. but if the content contains javascript then it is not executing. e.g. the javascript of my content is
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">alert('content');</script>
as i click a link to get this content, it is not executing.
does anybody hav the answer for my problem?? thanx in advance...
What JavaScript you want to execute that you do Coding on Client side.
Good Luck.

Kind regards,
Dmjpro.
Sep 11 '07 #2
pbmods
5,821 Expert 4TB
Heya, KSR.

What do you want your code to do? Give an example.
What is your code doing that you don't want it to do? Give an example.
What is your code *not* doing that it is supposed to? Give an example.
Sep 11 '07 #3
ksr04
3
hi pbmods,
in my page i have a navigation column and a content column.... i use ajax to get the contents from another page and load tht in the conent column...
if the content is like
Expand|Select|Wrap|Line Numbers
  1. <table><tr><td>some content</td></tr></table>
then it loads without any problem....
but if the content is:
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">dothis();</script>
the function "dothis();" doesn't work.
the function "dothis();" works fine if called without ajax....

i think u got my point...
Sep 11 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by Pratik Patel | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.