createTextNode and IE7

J

Julian Turner

Randy Webb wrote:

[snip]
You load the HTML, insert it in a container, then want to execute the
script block. You run a function that evals the script contents. myVar
then becomes local to the function.
[/snip]

I see the point.

I suppose the question then is in what circumstances is myVar being
local a problem that does not have a work-around?
The biggest thing? I hate eval :)

It's reputation is definitely not helped when it is misused.

For a particularly egregious example of misuse, and for fun only, I use
eval for my own libraries to nest my modules (with a downward only
dependency)

E.g.

module1 - core functions
module2 - Array, String - uses module1
module3 - HTML - uses modules 2 and 2

function module1()
{
this.closure = function(source)
{
var retVal;
eval(source);
return retVal;
};

function module1Function() {
alert("hello from module1");
}
this.module1Function = module1Function;
}

function module2()
{
this.closure = function(source)
{
var retVal;
eval(source);
return retVal;
};

function module2Function() {
module1Function(); // Will be in scope chain
}
this.module2Function = module2Function;
}

function module3()
{
function module3Function() {
module2Function(); // Will be in scope chain
}
this.module3Function = module3Function
}

module1 = new module1();
module2 = module1.closure(module2.toString() + " retVal = new
module2()");
module3 = module2.closure(module3.toString() + "retVal = new
module3()");

module3.module3Function();

The real version is a little more friendly, but that hopefully
illustrates the insane gist of it.

I know, I know, closures, scopes and scope chain look-ups lead to poor
memory and speed performance, but in practice I am not noticing much of
a performance hit for modest applications.
Second scenario is one that I can not come up with a reasonable reason
to ever do but it involves a script block that traverses the tree going
upwards using parentNode to get to an element. As I say, that is a
perverse scenario that if I ever saw actual code that did it I would
probably wonder what insane asylum the author was a patient at.

I am not sure I follow this.

[snip]
Close. Three years ago you didn't see questions in this group with
regards to XMLHttpRequest and/or AJAX very often. Now, you see a
kazillion of them. The next phase of that, to me, is going to be script
issues and it is already happening where people are asking "How do I
make my scripts execute when loaded with AJAX" and I am simply trying to
be ahead of it and come up with an answer before the onslaught happens.
[/snip]

Anticipation is good.

[snip]
The approach I use, and prefer, for loading data is .js files and
loading them on the fly. The back end still has to be set up to create
those .js files and the main page is set up to handle it. I just find
the .js files simpler and more reliable than AJAX is all.
[/snip]

It is also patented!

<URL:http://patft.uspto.gov/netacgi/nph-...6,941,562.PN.&OS=PN/6,941,562&RS=PN/6,941,562>

Regards

Julian
 
R

Randy Webb

Julian Turner said the following on 12/5/2006 7:45 AM:
Randy Webb wrote:
The approach I use, and prefer, for loading data is .js files and
loading them on the fly. The back end still has to be set up to create
those .js files and the main page is set up to handle it. I just find
the .js files simpler and more reliable than AJAX is all.
[/snip]

It is also patented!

<URL:http://patft.uspto.gov/netacgi/nph-...6,941,562.PN.&OS=PN/6,941,562&RS=PN/6,941,562>

How does one challenge a US Patent then? I beat them to that by about 4
years or so. And, I can prove it.

March 9, 2003 is the date on the files in this FTP listing:

<URL: ftp://members.aol.com/justhikk/>

And that is precisely why I haven't updated that page is to date when I
first started using dynamic loading script files. And that is not when I
first started using it, it is when that page got last updated (after I
had it working). The only problem with that page is about half the .js
files didn't get created/uploaded.

So, how do I get my patent they stole from me?
 
J

Julian Turner

Randy said:
How does one challenge a US Patent then? I beat them to that by about 4
years or so. And, I can prove it.

March 9, 2003 is the date on the files in this FTP listing:

<URL: ftp://members.aol.com/justhikk/>

And that is precisely why I haven't updated that page is to date when I
first started using dynamic loading script files. And that is not when I
first started using it, it is when that page got last updated (after I
had it working). The only problem with that page is about half the .js
files didn't get created/uploaded.

So, how do I get my patent they stole from me?

I just mentioned it for a laugh :)

I don't know much about the US patent system, but I get the strong
impression (and I am happy to be corrected) that the US patent office
does not really do much of a prior-art search, and accepts almost
anything it is given, so that a number of speculative applications make
it onto the books and then get challenged later (if you have the money)
or ignored. If I am right, I can't say I agree with that system,
particularly when it comes to software, as patents and software do not
sit easily together.

The open source movement is partly in existence as a counter-balance to
this problem, I think.

Certainly in the UK (my jurisdiction), the patent office takes a lot
more persuading to grant a patent, software is very hard to patent
(although Microsoft and other large concerns are always trying to lobby
for more), and a patent can always be challenged by "prior art" or
"obviousness" later on.

Regards

Julian
 
V

VK

How does one challenge a US Patent then? I beat them to that by about 4
years or so. And, I can prove it.

March 9, 2003 is the date on the files in this FTP listing:

<URL: ftp://members.aol.com/justhikk/>

Alas, 2003 is not old enough, so you may safely remove these files.

Their priority is protected by the U.S. Provisional Application No.
60/251,056 filed Dec. 1, 2000

This way you need a something older than 12.01.2000

I also noticed an important patent status change since the last time I
checked it: it is not "pending request" anymore, it's "patented case"
now:

<http://portal.uspto.gov/external/po....c/6_0_69/.ce/7_0_3AB/.p/5_0_341/.d/0#7_0_3AB>

Eolas-2 is coming?
 
P

Peter Michaux

Peter said:
If you post some examples at a few different URLs then I can click them
in Safari 2.0.4 and if the issue is still interesting in a few weeks I
can also click them in Safari 1.3.9.

I've done most of the work to check out script insertion with
mainstream browsers and some exotics. See the tests and results

http://peter.michaux.ca/temp/insertScripts.html

The bad news is neither script insertion method works with NN6. The
iCab failure is a worry because that is a current release. Even if iCab
isn't mainstream some equally lesser known browsers on portable devices
could have failure too. I don't know about Safari <2 yet. Later today.

It would seem bad to depend on an technique for use with XHR when NN6
isn't really ancient yet has XHR. The fact some rare XHR browsers can't
use this technique makes me nervous that depending on the technique
could cause a major backfire in the future.

The eval() technique works. It is part of the language so part of an
old standard. I think using eval is the conservative choice.

Peter
 
R

Randy Webb

Peter Michaux said the following on 12/6/2006 4:32 PM:
I've done most of the work to check out script insertion with
mainstream browsers and some exotics.

Can I impose on you to ask to test this page with the browsers not
listed there?

<URL: http://members.aol.com/_ht_a/hikksnotathome/loadJSFile/index.html>

I edited it and added the browsers/OS that you have listed that aren't
on that page. They should show up with a blue background and "Untested"
in the boxes.

Firefox 2.0 WinXP - success on both.
Opera 9.0 WinXP - success on both.
Mozila 1.7.8 - success on both.

You can duplicate the results for IE6/XP for IE7/XP
The bad news is neither script insertion method works with NN6.

NN6 shouldn't be a concern as it is old enough that it isn't worth
worrying with. Netscape is up to 8.0 and NS users tend to parallel
Opera/Mozilla/Firefox users where they tend to keep it updated.
The iCab failure is a worry because that is a current release. Even if iCab
isn't mainstream some equally lesser known browsers on portable devices
could have failure too. I don't know about Safari <2 yet. Later today.

iCab doesn't like my dynamic loading either. Does it support XHR though?
It would seem bad to depend on an technique for use with XHR when NN6
isn't really ancient yet has XHR. The fact some rare XHR browsers can't
use this technique makes me nervous that depending on the technique
could cause a major backfire in the future.

No more so than depending on XHR to start with. If you are worried about
failure with executing the scripts because of an old browser then you
need to worry about using XHR before then.
The eval() technique works. It is part of the language so part of an
old standard. I think using eval is the conservative choice.

Then why not just make all your code strings and eval it? Seriously,
eval has its problems and it may solve some problems but it introduces
problems of its own as well.
 
P

Peter Michaux

Randy said:
Can I impose on you to ask to test this page with the browsers not
listed there?

<URL: http://members.aol.com/_ht_a/hikksnotathome/loadJSFile/index.html>

I edited it and added the browsers/OS that you have listed that aren't
on that page. They should show up with a blue background and "Untested"
in the boxes.

Ok. I clicked each of the buttons and refreshed between each click. If
I saw an alert I called it a success.

Results are appended at the bottom of this email for the browsers I
have. I checked Konq by chatting on irc #kde so couldn't check now.

BTW, where did you get OS X 10.6.2 ?!?!?!
NN6 shouldn't be a concern as it is old enough that it isn't worth
worrying with. Netscape is up to 8.0 and NS users tend to parallel
Opera/Mozilla/Firefox users where they tend to keep it updated.


iCab doesn't like my dynamic loading either. Does it support XHR though?

Yes iCab 3.0.3 does support XHR

I don't know what your tests are doing compared to mine but my simple
script insertions failed in iCab. Two of your tests worked.

No more so than depending on XHR to start with.

Yes more than depending on XHR. Actually that was my point. If NN6 has
XHR but can't insert scripts then the insert scripts is an added
limitation on the number of supported browsers. Again, I don't know
what is going on with your iCab tests but it is almost certain there
will be browsers that can't insert scripts but do have eval, don't you
think?

Really NN6 isn't my biggest concern. It is newer browsers in mobil
devices.

If you are worried about
failure with executing the scripts because of an old browser then you
need to worry about using XHR before then.
Agreed



Then why not just make all your code strings and eval it? Seriously,
eval has its problems and it may solve some problems but it introduces
problems of its own as well.

But I'm scared :S Scared of deploying a novel non-standard technique
that makes programming easier but that might break when another
standard technique that rarely involves any tricky programming is
almost guarrenteed success. Imagine having to explain that to the boss.
Two particular eff words might follow.

Peter


// ------------------------------------------------------------------

<tr>
<td class="PC" width="160px">Netscape 8.0.4</td>
<td class="PC" width="110px">Win XP</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="yes">Yes</td>
</tr>
<tr>
<td class="PC" width="160px">Netscape 7.0</td>
<td class="PC" width="110px">Win XP</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="yes">Yes</td>
</tr>
<tr>
<td class="PC" width="160px">Netscape 6.0</td>
<td class="PC" width="110px">Win XP</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="no">No</td>
</tr>
<tr>
<td class="MAC">Camino 1.0.3</td>
<td class="MAC">MacOS 10.4.8</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="yes">Yes</td>
<td></td>
</tr>
<tr>
<td class="MAC">Opera 9.02</td>
<td class="MAC">MacOS 10.4.8</td>
<td class="yes">Yes</td>
<td class="no">No</td>
<td class="yes">Yes</td>
<td></td>
</tr>
<tr>
<td class="MAC">Shiira 1.2.2</td>
<td class="MAC">MacOS 10.4.8</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="yes">Yes</td>
<td></td>
</tr>
<tr>
<td class="MAC">Sunrise 0.89</td>
<td class="MAC">MacOS 10.4.8</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="yes">Yes</td>
<td></td>
</tr>
<tr>
<td class="MAC">Firefox 2.0 </td>
<td class="MAC">MacOS 10.4.8</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="yes">Yes</td>
<td></td>
</tr>
<tr>
<td class="MAC">Firefox 1.5.0.8</td>
<td class="MAC">MacOS 10.4.8</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="yes">Yes</td>
<td></td>
</tr>
<tr>
<td class="MAC">iCab 3.0.3 </td>
<td class="MAC">MacOS 10.4.8</td>
<td class="no">No</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
<td></td>
</tr>
 
P

Peter Michaux

Peter said:
Randy Webb wrote:
I don't know what your tests are doing compared to mine but my simple
script insertions failed in iCab. Two of your tests worked.

I just read your source. I see that you are testing loading js files on
the fly vs. I was testing script insertion: apples and oranges.

Peter
 
R

Randy Webb

Peter Michaux said the following on 12/6/2006 11:59 PM:
Ok. I clicked each of the buttons and refreshed between each click. If
I saw an alert I called it a success.

Results are appended at the bottom of this email for the browsers I
have. I checked Konq by chatting on irc #kde so couldn't check now.

BTW, where did you get OS X 10.6.2 ?!?!?!

I was being pshycic :) Thank you for pointing out my typo error in a
copy paste. Not sure how I managed that.
Yes iCab 3.0.3 does support XHR

I don't know what your tests are doing compared to mine but my simple
script insertions failed in iCab. Two of your tests worked.

createElement test - uses createElement to create a script block and set
its .src property to load a .js file

change innerHTML - changes the innerHTML of a div tag to load a .js file

change source - changes the .src property of an existing script block
Yes more than depending on XHR. Actually that was my point. If NN6 has
XHR but can't insert scripts then the insert scripts is an added
limitation on the number of supported browsers.

If the string from an XHR requests has a script block in it, and you
insert it via innerHTML, then the script block gets loaded and executed
in early Netscape 6. Not sure what version of NS6 that changed in though.
Again, I don't know what is going on with your iCab tests but it is
almost certain there will be browsers that can't insert scripts but
do have eval, don't you think?

I don't think there is, I am pretty positive there are some around. But
the same goes for XHR where there will be browsers that support loading
scripts but don't support XHR. Its a tradeoff.
Really NN6 isn't my biggest concern. It is newer browsers in mobil
devices.

How many mobile devices support XHR though?
But I'm scared :S Scared of deploying a novel non-standard technique
that makes programming easier but that might break when another
standard technique that rarely involves any tricky programming is
almost guarrenteed success. Imagine having to explain that to the boss.
Two particular eff words might follow.

My point was that just because something works doesn't mean you should
do it that way. In the end eval may be the most reliable way to go but
until then, I am still working on this approach to go with my loadJSFile
function :)

<snip>
 
R

Randy Webb

Peter Michaux said the following on 12/7/2006 12:07 AM:
I just read your source. I see that you are testing loading js files on
the fly vs. I was testing script insertion: apples and oranges.

Yes, I am loading files on the fly. I am probably going to add something
along the lines of your test page results to it where it also indicates
support (or lack of) for changing the .text property of a script element
and the support for createTextNode
 
P

Peter Michaux

Randy said:
Yes, I am loading files on the fly. I am probably going to add something
along the lines of your test page results to it where it also indicates
support (or lack of) for changing the .text property of a script element
and the support for createTextNode

Let me know when and I'll do more clicking. I'm interested in these
results as a whole.

Peter
 
R

Randy Webb

Peter Michaux said the following on 12/7/2006 12:51 PM:
Let me know when and I'll do more clicking. I'm interested in these
results as a whole.

The preliminary file is here:

<URL: http://members.aol.com/_ht_a/hikksnotathome/loadJSFile/index2.html>

The results are mostly what you had already. I have to change the
functions to report errors and error out better. Right now, it simply
throws the default browser error. Probably change it to a function
similar to yours instead of throwing up error boxes. Also have to tinker
with the CSS some more (it scrolls off the screen in IE).
 
R

Randy Webb

RobG said the following on 12/13/2006 11:45 PM:
If I click on the "Create Element" button, I get the following error:

ocument is not defined -- index.html line 18

ocument.getElementById('scriptDiv').appendChild(s);
--^

I know :( I found that error after uploading it. I have a new one to
uploaded that has some updated information on the .text property and
createTextNode methods. It has also been moved/renamed to index.html
instead of index2.html:

<URL: http://members.aol.com/_ht_a/hikksnotathome/loadJSFile/>

index2.html has been deleted.
 
P

Peter Michaux

Randy said:
RobG said the following on 12/13/2006 11:45 PM:

I know :( I found that error after uploading it. I have a new one to
uploaded that has some updated information on the .text property and
createTextNode methods. It has also been moved/renamed to index.html
instead of index2.html:

<URL: http://members.aol.com/_ht_a/hikksnotathome/loadJSFile/>

I noticed a few things

In one row you have OS X 10.4 but all others are 10.4.8

You really have IE 5.2 on OS X 10.4? I just wonder because it came
standard on 10.3 and you have Safari 1.3 on 10.3.

What's going on with the contradictory iCab 3.0.3 results?

If iCab is the only current release browser that is red from left to
right do you just say "screw, iCab"?

Peter
 
R

Randy Webb

Peter Michaux said the following on 12/14/2006 2:08 AM:
I noticed a few things

In one row you have OS X 10.4 but all others are 10.4.8

All of the mac data comes from other people. I honestly don't remember
who gave me the 10.4 data (I should start noting it I guess) but if you
can confirm the data as being accurate in 10.4.8 then it can be changed
to be uniform. The 10.4.8 came from your page, the 10.4 probably came
from either Richard Cornford or ASM.
You really have IE 5.2 on OS X 10.4? I just wonder because it came
standard on 10.3 and you have Safari 1.3 on 10.3.

<shrug> Another of those me depending on others for the mac results. I
will try to find where I got that data from (Its in the archives
somewhere). For now it is changed to 10.3 until I can confirm it. I am
probably going to rearrange the mac section by OS version number so that
all the 10.3's are together, 10.4, etc.. Probably do the WinME/XP
section the same way.
What's going on with the contradictory iCab 3.0.3 results?

More than likely, a copy/paste error on my part.
If iCab is the only current release browser that is red from left to
right do you just say "screw, iCab"?

Pretty much :) iCab doesn't seem to be a very dynamic scriptable browser.

I corrected the iCab 3.0.3 results locally and will upload it tonight.
 
P

Peter Michaux

Hi Randy,

Randy said:

Is this file really working? Now I'm getting all failures on the first
test in the XP browsers I tried. It is strange though because on the
first two clicks I see no activity, on the third click i see
"Downloading blah blah blah" in the status bar but when it finishes
downloading I don't see the alert. I think the other tests are working
but maybe you can look again before I click about 100 times in 20
browsers.

Off topic but what is the difference with putting urls in <URL: > vs.
just in <> like VK suggested?

Peter
 
J

John W. Kennedy

Peter said:
Hi Randy,



Is this file really working? Now I'm getting all failures on the first
test in the XP browsers I tried. It is strange though because on the
first two clicks I see no activity, on the third click i see
"Downloading blah blah blah" in the status bar but when it finishes
downloading I don't see the alert. I think the other tests are working
but maybe you can look again before I click about 100 times in 20
browsers.

Off topic but what is the difference with putting urls in <URL: > vs.
just in <> like VK suggested?

The <URL: > convention was once an official part of the URL standard, as
the one and only correct way to embed a URL in plain text. It was
removed from the standard for lack of use, but a good deal of software
still supports it.

The < > convention was never official, but some software supports it all
the same.

I have personally had better results with the <URL: > convention.
 
P

Peter Michaux

John said:
Peter Michaux wrote:

The <URL: > convention was once an official part of the URL standard, as
the one and only correct way to embed a URL in plain text. It was
removed from the standard for lack of use, but a good deal of software
still supports it.

The < > convention was never official, but some software supports it all
the same.

I have personally had better results with the <URL: > convention.

Thanks.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top