473,394 Members | 1,735 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,394 software developers and data experts.

SCRIPT SRC tag not working from AJAX

49
I have this piece of code:

Expand|Select|Wrap|Line Numbers
  1. <TABLE ID="weatherpane" BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="372" VALIGN="TOP" BGCOLOR="#475380">
  2.     <TR> 
  3.         <TD WIDTH="372" HEIGHT="43" CLASS="Basic_ARIAL_BLACK_EXTRALARGE" ALIGN="CENTER" STYLE="padding:20 0 0 0">The Weather
  4.         </TD>
  5.     </TR>
  6.     <TR>
  7.         <TD ALIGN="CENTER" STYLE="padding:8 0 20 0;">
  8.             <SCRIPT SRC='http://voap.weather.com/weather/oap/INXX0057?template=EVNTH&par=1005416873&unit=1&key=bfb3d15498a88172a8ed7720a38c102d'>
  9.             </SCRIPT> 
  10.         </TD>
  11.     </TR>
  12. </TABLE>
  13.  
which works by itself, but does not work when it comes into a div that is populated by AJAX. I tried the URL in the SCRIPT SRC tag by itself, and that works fine too. Does anyone know why this happens?

Thank you very much for your time!
Aug 5 '07 #1
2 1445
knkk
49
I solved the problem. It was not a pure solution that anyone else might be able to benefit from, but one specific to my case.

I needed to take the iframe route - the AJAX code would update a div (through the innerHTML route) with an iframe tag. The iframe would then fetch the content of the SCRIPT SRC, which was JS code that innerHTML would not execute, but an iframe will (innerHTML does not execute JS code, which is the fundamental problem here).

Basically, I put just the part that had the SCRIPT SRC tag in an iframe, and so the innerHTML would output something like:

Expand|Select|Wrap|Line Numbers
  1. <table>
  2. something
  3. </table>
  4. <iframe>
  5. something
  6. </iframe>
  7.  
I did this, instead of putting the table also into the iframe, since the table contained some links that needed access to the rest of the page (they were AJAX links, and the div that they had to update was in the rest of the page).

The point is, I could isolate the script src into an iframe because of the nature of my code here. It might or might not work for others.
Aug 5 '07 #2
pbmods
5,821 Expert 4TB
Heya, knkk.

Thanks for posting your solution.

Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)
Aug 5 '07 #3

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

Similar topics

1
by: Grzegorz ¦lusarek | last post by:
Hello everyone. I1m writing webb aplication using AJAX (prototype library: http://prototype.conio.net/ and scriptacuolous:http://script.aculo.us/). My Problem is that that I'm doing...
13
by: Marvin Zhang | last post by:
Hi, I'm not familiar with web programming, but I have a problem here. I have a page. When a user click one button on it, I will use AJAX to request a PHP script which will do a bunch of tasks,...
8
by: jackrabbithanna | last post by:
I'm using a ajax script the uses a tabbed div that fetches a remote webpage to display for each tab.when clicked. the script works fine except for one thing. The content of the page i want to...
5
by: camphor | last post by:
hi, I have found an upload script in hotscripts and have implemented it into the website, I followed the installation steps to 'give write permissions to php on the upload folder (which is...
7
by: mike57 | last post by:
The minimal AJAX script below works in Firefox, but not in IE, Opera, or Chrome. I could use some suggestions or referrals to resources that will help me get the script working in other browsers. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.