469,344 Members | 6,547 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Why won't SRC work?

59
Hi
I am trying to run an external javascript that is on one of my other systems

When i view the source of the page the code i see is
Expand|Select|Wrap|Line Numbers
  1.  
  2. <SCRIPT language="JavaScript"> 
  3. document.write('<iframe width="400" height="200" allowtransparency="true" scrolling="no" frameborder="0" hspace="0" vspace="0" src="/websnips copy/index.php/widget/show/aHR0cDovL3d3dy5iYmMuY28udWsvbG9uZG9uL25ld3Mv/156"></iframe>');
  4. </SCRIPT>

I am trying to create a document like this
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" src="http://localhost:8888/websnips%20copy/index.php/widget/widget/aHR0cDovL3d3dy5iYmMuY28udWsvbG9uZG9uL25ld3Mv/156"></script>
  2.  
Which should embed the script above it, but it doesn't. Can anyone help me fix this problem?

Thanks
Nov 16 '08 #1
3 1019
Markus
6,050 Expert 4TB
The .js file doesn't need <script ...></script> inside it: just the javascript code. Also, the src attrib should point to an actually .js file, I believe.
Nov 16 '08 #2
ojsimon
59
The .js file doesn't need <script ...></script> inside it: just the javascript code. Also, the src attrib should point to an actually .js file, I believe.
Problem is that it is an automated file and does not have any . extention so i need to define it as js?

Thanks
Nov 16 '08 #3
Markus
6,050 Expert 4TB
Problem is that it is an automated file and does not have any . extention so i need to define it as js?

Thanks
Well, the file that is output needs a mimetype that is equivalent to text/javascript. Maybe you can use something like php to get the contents of that 'automated file' and output it to the browser between <script> tags.

Also, the language attribute is deprecated (ie don't use it). Use type="text/javascript" instead.
Nov 16 '08 #4

Post your reply

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

Similar topics

16 posts views Thread by Kerry Neilson | last post: by
1 post views Thread by Jim | last post: by
7 posts views Thread by simon | last post: by
11 posts views Thread by John Ortt | last post: by
7 posts views Thread by Eran.Yasso | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | 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.