473,373 Members | 1,121 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,373 software developers and data experts.

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 1207
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

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

Similar topics

2
by: Jake Barnes | last post by:
Using javascript closures to create singletons to ensure the survival of a reference to an HTML block when removeChild() may remove the last reference to the block and thus destory the block is...
1
by: vocalise | last post by:
The title probably isn't very clear, but I haven't been able to find this problem (or I must be having problems figuring out which search strings to use) so I apologize if this has been addressed...
4
by: cmo | last post by:
What I'm trying to do is to display a loading screen while an ajax request executes. I have a page that is fairly long with several tables worth of data and the sorting/pagination of each table is...
1
by: JohnnieTech | last post by:
I am using some javascript/ajax to load content into a main div. The problem I am running into is that it will work in IE but not in FF. In FF I don't get any sort of load at all. I have a 1...
8
by: Pratik Patel | last post by:
Hello, I used innerHTML to assign HTML content. but in my HTML page content have also some javascript function and it will run when page load. bu when HTML code assgin thru innerHTML then this...
10
by: paulie | last post by:
Hi, I have been experiencing an issue when trying to use AJAX to reload a DIV area using a timer of 2000ms, which contains a html page with another DIV and javascript. Scenario -------------...
22
by: Dan Rumney | last post by:
Hi all, I've been writing Javascript for quite a while now and have, of late, been writing quite a lot of AJAX and AJAX-related code. In the main, my dynamically generated pages are created...
9
by: mrcheeky | last post by:
Hi, I'm stuck, but it's almost working! From a html page, my javascript calls a server-side php script. The php reads a value from a server-side .txt file and passes it back as a javascript...
5
by: quirk | last post by:
I am trying to write a script where a page is populated with some maths questions, user answers them (it's timed but I've left this bit out), gets results on same page and ajax takes their score,...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.