/    Sign up×
Community /Pin to ProfileBookmark

FF works great, MSIE: nfg, any reason why?

First off, the attached code is not for any project due for class or anything else.

That being said, I have found a number of ‘neat’ functions,
mostly recommended by other forum members,
that I usually cannot relocate when I want to use them.

(“CRS” problem that occurs with maturity).

I wanted to put them into one site that I would be able to remember
with the ability to copy and paste the function into other projects.

I created a tab display that works very well in FF on PC and iMac.

However, after a certain point, the display in MSIE gets lost.
I have tried putting in selective alerts to isolate the problem,
but I don’t seem to be able to put them where they do any good for me.

To see the problem, select some of the later tabs or try running some of the examples
from some of the buttons within the tab display in both MSIE and FF.

Can any one see an obvious mistake that allows all to work well in FF, but becomes buggy in MSIE?

?

[upl-file uuid=3b0a13d8-3892-4054-a07d-cd27ccde4765 size=16kB]Utils.txt[/upl-file]

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@KorJun 25.2009 — First thing I have noticed is that your document has no Doctype.

http://www.w3schools.com/tags/tag_DOCTYPE.asp

Without a certain DTD, browsers' interpretors work in so called "quirks mode" (in opposition to the "strict mode"), which may provoke weird interpretation of CSS and javascript codes.
Copy linkTweet thisAlerts:
@astupidnameJun 25.2009 — It is strange, if you alert the elements in the choose function, TEXT8 onwards are null for the div element. If you comment out the script that is in the TEXT7 div it works fine. For some reason it is having trouble with the document.write of the English.toString(). I found that if I change that to replace < or > it works fine then.

Change TEXT7 div to the following:
[code=html] <div id="TEXT7" class="TEXT">
<p>

7. Represent a small bilingual lexicon as a Javascript object in the following fashion <br>
{"merry":"god", "christmas":"jul", "and":"och",
"happy":gott", "new":"nytt", "year":"&#229;r"} <br>
and use it to translate your Christmas cards from English into Swedish.<br>
<input type="button" onclick="Solution7()" value='Run Solution'>
<input type="button"
onclick="document.getElementById('Solutions').innerHTML=Solution7.toString()"
value='View Solution'>
<input type="button" onclick="FunctionDisplays(English)" value='View Functions'>
<pre>
var lexicon = {"merry":"god", "christmas":"jul", "and":"och",
"happy":gott", "new":"nytt", "year":"&#229;r"};
var spanish = {"merry":"feliz", "christmas":"navidad", "and":"y",
"happy":"feliz", "new":"nueve", "year":"anos"};
<script type="text/javascript">var str = English.toString(); document.write(str.replace(/</g,'&lt;').replace(/>/g,'&gt;'));</script>
</pre>
</div>[/code]

Note the changes within the script only. If you look at all your other document.write's that write out functions that contain those characters < > you will find you will want to do same to them, as they are all stopping at the first < character, typically in loop definitions. So you might want to make a function such as:

function preDW(str) {

document.write(str.replace( .... etc etc you get the picture, then use in place of your document.write's within the pre tags

edit: actually, just the '<' characters seem to need to be replaced
Copy linkTweet thisAlerts:
@JMRKERauthorJun 25.2009 — Thank you both.

I'll give each change an attempt and report back about success.

Appreciate the looks and comments. ?
×

Success!

Help @JMRKER spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...