473,735 Members | 7,637 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

script tags in ie external js dynamic recursive html page creation - not a normal problem


Hello all,

I've searched just about everything and although I can see that other
people are having problems, but theirs don't seem to relate, so in a
last ditch attempt, my posting!

Script tags are hanging in ie when generating a html page in a new
window. Works fine in netscape/moz. I know ie does some weird things
with scripts but...

This is just a simple example (so not actual code):-

I have a page something like this:-

<html><head>
<script language="text/javascript" src="something. js>
</head>
<body>blah blah etc etc
.....onClick="s omefunctionin-something.js">
.....
</html>

the function in "something. js" looks like this:-

var winptr=document .open("", "", "");
winptr.document .writeln ("<html><head>" );
winptr.document .writeln('<scri pt language="text/javascript"
src="something. js"></script>');
winptr..finish off the page etc etc
winptr.document .close();

If I take out the <script> bit in the script, no probs.

I've tried masking the script tags so doing
winptr.document .writeln('<scri ' + 'pt> etc etc but still no go. IE
just seems to crunch the code, I wouldn't mind but the script is
already downloaded in order to generate the first page...

Even if I put the code inline I suspect that I would have exactly the
same problem, plus who wants to have to 2 loads of code to edit each
time you wanted to do something?

Any help ideas very gratefully received.

Paul
Jul 23 '05 #1
13 1892
<no****@nowhere .com> wrote in message
news:uv******** *************** *********@4ax.c om...

Hello all,

I've searched just about everything and although I can see that other
people are having problems, but theirs don't seem to relate, so in a
last ditch attempt, my posting!

Script tags are hanging in ie when generating a html page in a new
window. Works fine in netscape/moz. I know ie does some weird things
with scripts but...

This is just a simple example (so not actual code):-

I have a page something like this:-

<html><head>
<script language="text/javascript" src="something. js>
</head>
<body>blah blah etc etc
....onClick="so mefunctionin-something.js">
....
</html>

the function in "something. js" looks like this:-

var winptr=document .open("", "", "");
winptr.document .writeln ("<html><head>" );
winptr.document .writeln('<scri pt language="text/javascript"
src="something. js"></script>');
winptr..finish off the page etc etc
winptr.document .close();

If I take out the <script> bit in the script, no probs.

I've tried masking the script tags so doing
winptr.document .writeln('<scri ' + 'pt> etc etc but still no go. IE
just seems to crunch the code, I wouldn't mind but the script is
already downloaded in order to generate the first page...

Even if I put the code inline I suspect that I would have exactly the
same problem, plus who wants to have to 2 loads of code to edit each
time you wanted to do something?

Any help ideas very gratefully received.

Paul

Change
<script language="text/javascript" src="something. js>

to
<script type="text/javascript" src="something. js">
Change
winptr.document .writeln('<scri pt language="text/javascript"
src="something. js"></script>');

to
winptr.document .writeln('<' + 'script type="text/javascript"
src="something. js"></' + 'script>');

Does it work now?
Jul 23 '05 #2

Nope still no go, but then I'm still fighting with the same problem
"something. js" has already been parsed at the point the new window is
generated.

Paul
On Wed, 16 Mar 2005 19:51:23 -0600, "McKirahan" <Ne**@McKirahan .com>
wrote:
<no****@nowher e.com> wrote in message
news:uv******* *************** **********@4ax. com...

Hello all,

I've searched just about everything and although I can see that other
people are having problems, but theirs don't seem to relate, so in a
last ditch attempt, my posting!

Script tags are hanging in ie when generating a html page in a new
window. Works fine in netscape/moz. I know ie does some weird things
with scripts but...

This is just a simple example (so not actual code):-

I have a page something like this:-

<html><head>
<script language="text/javascript" src="something. js>
</head>
<body>blah blah etc etc
....onClick="so mefunctionin-something.js">
....
</html>

the function in "something. js" looks like this:-

var winptr=document .open("", "", "");
winptr.document .writeln ("<html><head>" );
winptr.document .writeln('<scri pt language="text/javascript"
src="something. js"></script>');
winptr..finish off the page etc etc
winptr.document .close();

If I take out the <script> bit in the script, no probs.

I've tried masking the script tags so doing
winptr.document .writeln('<scri ' + 'pt> etc etc but still no go. IE
just seems to crunch the code, I wouldn't mind but the script is
already downloaded in order to generate the first page...

Even if I put the code inline I suspect that I would have exactly the
same problem, plus who wants to have to 2 loads of code to edit each
time you wanted to do something?

Any help ideas very gratefully received.

Paul

Change
<script language="text/javascript" src="something. js>

to
<script type="text/javascript" src="something. js">
Change
winptr.documen t.writeln('<scr ipt language="text/javascript"
src="something .js"></script>');

to
winptr.documen t.writeln('<' + 'script type="text/javascript"
src="something .js"></' + 'script>');

Does it work now?


Jul 23 '05 #3

ooops emailed rather than posted... I'll try again:-
Yeah sorry, the type is correct - just was tapping away too quickly
and put language.

No the problem is still there. It is something to do with the
</script> tag and I think I have a suspect...

Masking the end script tag should work, but I think that as the same
javascript has already been downloaded and parsed and i'm putting the
same script in the generated page i get problems.

Just checking putting another js file instead, one that hasn't been
seen....

Paul

On Wed, 16 Mar 2005 19:51:23 -0600, "McKirahan" <Ne**@McKirahan .com>
wrote:
<no****@nowher e.com> wrote in message
news:uv******* *************** **********@4ax. com...

Hello all,

I've searched just about everything and although I can see that other
people are having problems, but theirs don't seem to relate, so in a
last ditch attempt, my posting!

Script tags are hanging in ie when generating a html page in a new
window. Works fine in netscape/moz. I know ie does some weird things
with scripts but...

This is just a simple example (so not actual code):-

I have a page something like this:-

<html><head>
<script language="text/javascript" src="something. js>
</head>
<body>blah blah etc etc
....onClick="so mefunctionin-something.js">
....
</html>

the function in "something. js" looks like this:-

var winptr=document .open("", "", "");
winptr.document .writeln ("<html><head>" );
winptr.document .writeln('<scri pt language="text/javascript"
src="something. js"></script>');
winptr..finish off the page etc etc
winptr.document .close();

If I take out the <script> bit in the script, no probs.

I've tried masking the script tags so doing
winptr.document .writeln('<scri ' + 'pt> etc etc but still no go. IE
just seems to crunch the code, I wouldn't mind but the script is
already downloaded in order to generate the first page...

Even if I put the code inline I suspect that I would have exactly the
same problem, plus who wants to have to 2 loads of code to edit each
time you wanted to do something?

Any help ideas very gratefully received.

Paul

Change
<script language="text/javascript" src="something. js>

to
<script type="text/javascript" src="something. js">
Change
winptr.documen t.writeln('<scr ipt language="text/javascript"
src="something .js"></script>');

to
winptr.documen t.writeln('<' + 'script type="text/javascript"
src="something .js"></' + 'script>');

Does it work now?


Jul 23 '05 #4

If I did the dynamics server side, I don't think I'd have the problem,
but because its client side.... and I'm not able to do server side....
On Thu, 17 Mar 2005 01:40:29 GMT, no****@nowhere. com wrote:

Hello all,

I've searched just about everything and although I can see that other
people are having problems, but theirs don't seem to relate, so in a
last ditch attempt, my posting!

Script tags are hanging in ie when generating a html page in a new
window. Works fine in netscape/moz. I know ie does some weird things
with scripts but...

This is just a simple example (so not actual code):-

I have a page something like this:-

<html><head>
<script language="text/javascript" src="something. js>
</head>
<body>blah blah etc etc
....onClick="s omefunctionin-something.js">
....
</html>

the function in "something. js" looks like this:-

var winptr=document .open("", "", "");
winptr.documen t.writeln ("<html><head>" );
winptr.documen t.writeln('<scr ipt language="text/javascript"
src="something .js"></script>');
winptr..fini sh off the page etc etc
winptr.documen t.close();

If I take out the <script> bit in the script, no probs.

I've tried masking the script tags so doing
winptr.documen t.writeln('<scr i' + 'pt> etc etc but still no go. IE
just seems to crunch the code, I wouldn't mind but the script is
already downloaded in order to generate the first page...

Even if I put the code inline I suspect that I would have exactly the
same problem, plus who wants to have to 2 loads of code to edit each
time you wanted to do something?

Any help ideas very gratefully received.

Paul


Jul 23 '05 #5

Got it, I split the line out onto two different write methods so
(rather than a single writeln with splits):-

wpoint.document .write('<script type="text/javascript"
src="includes/reload.js"><');
wpoint.document .write('/');
wpoint.document .write('script' );
sigh

nice to sort your own problems out I feel!

Paul
On Thu, 17 Mar 2005 02:14:42 GMT, no****@nowhere. com wrote:

If I did the dynamics server side, I don't think I'd have the problem,
but because its client side.... and I'm not able to do server side....
On Thu, 17 Mar 2005 01:40:29 GMT, no****@nowhere. com wrote:

Hello all,

I've searched just about everything and although I can see that other
people are having problems, but theirs don't seem to relate, so in a
last ditch attempt, my posting!

Script tags are hanging in ie when generating a html page in a new
window. Works fine in netscape/moz. I know ie does some weird things
with scripts but...

This is just a simple example (so not actual code):-

I have a page something like this:-

<html><head >
<script language="text/javascript" src="something. js>
</head>
<body>blah blah etc etc
....onClick=" somefunctionin-something.js">
....
</html>

the function in "something. js" looks like this:-

var winptr=document .open("", "", "");
winptr.docume nt.writeln ("<html><head>" );
winptr.docume nt.writeln('<sc ript language="text/javascript"
src="somethin g.js"></script>');
winptr..finis h off the page etc etc
winptr.docume nt.close();

If I take out the <script> bit in the script, no probs.

I've tried masking the script tags so doing
winptr.docume nt.writeln('<sc ri' + 'pt> etc etc but still no go. IE
just seems to crunch the code, I wouldn't mind but the script is
already downloaded in order to generate the first page...

Even if I put the code inline I suspect that I would have exactly the
same problem, plus who wants to have to 2 loads of code to edit each
time you wanted to do something?

Any help ideas very gratefully received.

Paul


Jul 23 '05 #6

doh

it seems hit or miss with this method - so not sure whats going
on....as it still sometimes doesn't do what it should.

Any ideas?

Paul


On Thu, 17 Mar 2005 02:28:33 GMT, no****@nowhere. com wrote:

Got it, I split the line out onto two different write methods so
(rather than a single writeln with splits):-

wpoint.documen t.write('<scrip t type="text/javascript"
src="include s/reload.js"><');
wpoint.documen t.write('/');
wpoint.documen t.write('script ');
sigh

nice to sort your own problems out I feel!

Paul
On Thu, 17 Mar 2005 02:14:42 GMT, no****@nowhere. com wrote:

If I did the dynamics server side, I don't think I'd have the problem,
but because its client side.... and I'm not able to do server side....
On Thu, 17 Mar 2005 01:40:29 GMT, no****@nowhere. com wrote:

Hello all,

I've searched just about everything and although I can see that other
people are having problems, but theirs don't seem to relate, so in a
last ditch attempt, my posting!

Script tags are hanging in ie when generating a html page in a new
window. Works fine in netscape/moz. I know ie does some weird things
with scripts but...

This is just a simple example (so not actual code):-

I have a page something like this:-

<html><hea d>
<script language="text/javascript" src="something. js>
</head>
<body>blah blah etc etc
....onClick= "somefuncti onin-something.js">
....
</html>

the function in "something. js" looks like this:-

var winptr=document .open("", "", "");
winptr.docum ent.writeln ("<html><head>" );
winptr.docum ent.writeln('<s cript language="text/javascript"
src="somethi ng.js"></script>');
winptr..fini sh off the page etc etc
winptr.docum ent.close();

If I take out the <script> bit in the script, no probs.

I've tried masking the script tags so doing
winptr.docum ent.writeln('<s cri' + 'pt> etc etc but still no go. IE
just seems to crunch the code, I wouldn't mind but the script is
already downloaded in order to generate the first page...

Even if I put the code inline I suspect that I would have exactly the
same problem, plus who wants to have to 2 loads of code to edit each
time you wanted to do something?

Any help ideas very gratefully received.

Paul


Jul 23 '05 #7
no****@nowhere. com wrote:
doh

it seems hit or miss with this method - so not sure whats going
on....as it still sometimes doesn't do what it should.

Any ideas?

Paul


On Thu, 17 Mar 2005 02:28:33 GMT, no****@nowhere. com wrote:

Got it, I split the line out onto two different write methods so
(rather than a single writeln with splits):-

wpoint.documen t.write('<scrip t type="text/javascript"
src="include s/reload.js"><');
wpoint.documen t.write('/');
wpoint.documen t.write('script ');
sigh

nice to sort your own problems out I feel!

Paul
On Thu, 17 Mar 2005 02:14:42 GMT, no****@nowhere. com wrote:

If I did the dynamics server side, I don't think I'd have the problem,but because its client side.... and I'm not able to do server side....

On Thu, 17 Mar 2005 01:40:29 GMT, no****@nowhere. com wrote:
Hello all,

I've searched just about everything and although I can see that otherpeople are having problems, but theirs don't seem to relate, so in alast ditch attempt, my posting!

Script tags are hanging in ie when generating a html page in a new
window. Works fine in netscape/moz. I know ie does some weird thingswith scripts but...

This is just a simple example (so not actual code):-

I have a page something like this:-

<html><hea d>
<script language="text/javascript" src="something. js>
</head>
<body>blah blah etc etc
....onClick= "somefuncti onin-something.js">
....
</html>

the function in "something. js" looks like this:-

var winptr=document .open("", "", "");
winptr.docum ent.writeln ("<html><head>" );
winptr.docum ent.writeln('<s cript language="text/javascript"
src="somethi ng.js"></script>');
winptr..fini sh off the page etc etc
winptr.docum ent.close();

If I take out the <script> bit in the script, no probs.

I've tried masking the script tags so doing
winptr.docum ent.writeln('<s cri' + 'pt> etc etc but still no go. IEjust seems to crunch the code, I wouldn't mind but the script is
already downloaded in order to generate the first page...

Even if I put the code inline I suspect that I would have exactly thesame problem, plus who wants to have to 2 loads of code to edit eachtime you wanted to do something?

Any help ideas very gratefully received.

Paul


All you need is:

......src="some thing.js"><\/script>');

Some 'actual code' might help.... #;-)

Jul 23 '05 #8
no****@nowhere. com wrote:
<snip>
I have a page something like this:- <snip> var winptr=document .open("", "", "");
winptr.document .writeln ("<html><head>" );
winptr.document .writeln('<scri pt language="text/javascript"
src="something. js"></script>'); <snip> Even if I put the code inline I suspect that I would
have exactly the same problem, ...

<snip>

It is a pity you didn't actually try that as you may have learnt
something useful in the process. If you open a new window with no URL in
the argument for the - window.open - call what is the base URL of the
new window? And if you then express the URL of the imported script file
as a relative URL, what is it going to be relative to?

Richard.
Jul 23 '05 #9
Since you are looking for ideas about how to get a <script> tag into
a new window that you are creating, which <script> has already been
loaded into the creator, here are three:

In the new window, put an empty SCRIPT tag,
<script type='text/javascript src="" id=newScript><\/script>

Then in IE, you can fish out those scripts by
document.getEle mentById() and set the src. IE should
be cacheing that .js file so you should be set.

The second idea (only one I haven't tried) is to do a
clone node of the <SCRIPT> node in question.
These things live off the <HEAD> element,
regardless of where they're defined (as far as I've
found in my experimentation ):
var head = document.docume ntElement.getEl ementsByTagName ("HEAD")[0];
var aScript = head.getElement sByTagName("SCR IPT");
Now fish out the script element you want, clone it
and plunk it into the new document (possibly, maybe,
on a good day?).

The third idea is that since the script is already loaded
in the caller, you could just reference it in the caller
window.opener.f unctionYouWantT oCall
Course, you have to be careful about scope here, and
also about whether the caller has been closed or not.

Also, here's some discussion on the topic:
http://groups-beta.google.com/group/...d4f6806b71219c
Csaba Gabor from Vienna
Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
4230
by: Johnny Knoxville | last post by:
I've added a favicon to my site (http://lazyape.filetap.com/) which works fine if you add the site to favourites the normal way, but I have some JavaScript code on a couple of pages with a link, which when you click it bookmarks the site (much easier). The favicon is never saved if the site is bookmarked this way. Does anyone have any ideas how to fix this?? This is the code: <script language="JavaScript">
24
3553
by: Day Bird Loft | last post by:
Web Authoring | Meta-Tags The first thing to understand in regard to Meta Tags is the three most important tags placed in the head of your html documents. They are the title, description, and keyword meta-tags. If you are missing any of these meta-tags you are missing the boat. If you use the following meta-tag formula, and you are not trying to deceive the spiders, I guarantee you will succeed in increasing your placement in the...
30
3902
by: Toni Mcintyre | last post by:
i'm having 2 problems with the http://validator.w3.org 1. if i have: <meta http-equiv="Content-Script-Type" content="text/javascript"> then why do i need <script type=text/javascript> everywhere??? i'm writing most of my code by hand, so this is a lot of extra typing or global search and replace later 2. the other problem is with my include files: i usually <script src="foo.js"></script>
11
3076
by: rajarao | last post by:
hi I want to remove the content embedded in <script> and </script> tags submitted via text box. My java script should remove the content embedded between <script> and </script> tag. my current code is function RemoveHTMLScript(strText) { var regEx = /<script\w*<\/script>/g
38
7161
by: | last post by:
I have a script... ----- <SCRIPT language="JavaScript" type="text/javascript"> <!-- function makeArray() { for (i = 0; i<makeArray.arguments.length; i++) this = makeArray.arguments; } function makeArray0() {
7
7629
by: gorkos | last post by:
Hi, I am two days trying to solve a problem with some pages, which i get through HTTPWebRequest. Error is that some pages need Script to be enabled. But how to do this in HTTPWebRequest class?
3
2959
by: Water Cooler v2 | last post by:
Questions: 1. Can there be more than a single script block in a given HEAD tag? 2. Can there be more than a single script block in a given BODY tag? To test, I tried the following code. None of the script gets executed. Can someone please give me a direction as to what I may be missing? Thanks.
7
2896
by: ojsimon | last post by:
Hi I found this script on a forum and have been trying to make it work, but all it returns is a blank screen, i tried using the debug error reporting but got nothing from that either just a blank page, here is the code<?php //In this case, it fetches a search for "fresh content" from www.alltheweb.com, whom we hope you will visit. $theLocation="http://www.alltheweb.com/search?cat=web&q=fresh+content&phrase=on&h=50"; //Below, at $start and...
2
2699
by: Jay | last post by:
I have a web app running on the windows CE device. In one of the asp.net pages - it has javascript code. That seems to have a memory leak. When I run the web app - in about one hour, the app hangs. I looked at the memory and it seems to be full. I removed all the javascript code - and the app seems to be have no leaks. As soon as I include my javascript code - the memory consumption gradually increases. Whether I actually invoke the...
0
8962
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8785
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9327
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9251
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9200
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6747
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6049
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3273
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2188
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.