/    Sign up×
Community /Pin to ProfileBookmark

HELP! JS is not working in Firefox and Chrome

HELP! hi guys, I have a problem with my JS pass value from one page to another, the code is fine working with IE, but not in Firefox and Chrome those browers, why? Can somebody give some advises? Thanks.

below is the part of the codes,

<SCRIPT type=text/javascript>
function printpage()
{
window.print()
}
function toggleIt(e){
e.style.visibility = (e.style.visibility == “visible”) ? “hidden” :
“visible”;
}
</SCRIPT>

<FORM id=Form1 name=temps action=PrintCashFlow.asp>

<SCRIPT LANGUAGE=”JavaScript”><!–
var splitIndex = 0, splitArray = new Object();
split(passed,’&’);
for (var i=0; i < splitIndex; i=i+2) {
if (splitArray[i] == ‘arv’)
document.Form1.arv.value = unescape(splitArray[i+1]);
if (splitArray[i] == ‘exp’)
document.Form1.exp.value = unescape(splitArray[i+1]);
if (splitArray[i] == ‘ra’)
document.Form1.ra.value = unescape(splitArray[i+1]);
if (splitArray[i] == ‘IR’)
document.Form1.IR.value = unescape(splitArray[i+1]);
if (splitArray[i] == ‘YR’)
document.Form1.YR.value = unescape(splitArray[i+1]);
if (splitArray[i] == ‘rpm’)
document.Form1.rpm.value = unescape(splitArray[i+1]);

if (splitArray[i] == ‘AT’)
document.Form1.AT.value = unescape(splitArray[i+1]);
if (splitArray[i] == ‘AI’)
document.Form1.AI.value = unescape(splitArray[i+1]);

if (splitArray[i] == ‘ri’)
document.Form1.ri.value = unescape(splitArray[i+1]);
if (splitArray[i] == ‘PI’)
document.Form1.PI.value = unescape(splitArray[i+1]);

if (splitArray[i] == ‘MT’)
document.Form1.MT.value = unescape(splitArray[i+1]);
if (splitArray[i] == ‘MI’)
document.Form1.MI.value = unescape(splitArray[i+1]);
if (splitArray[i] == ‘tmp’)
document.Form1.tmp.value = unescape(splitArray[i+1]);
if (splitArray[i] == ‘tcf’)
document.Form1.tcf.value = unescape(splitArray[i+1]);

if (splitArray[i] == ‘rgfa’)
document.Form1.rgfa[splitArray[i+1]].checked = true;
}
//–></SCRIPT>
<form id=”Form1″ name=”temps” action=”index.html”>
<TABLE id=”Table2″ style=”Z-INDEX: 100; LEFT: 128px; WIDTH: 488px; POSITION: absolute; TOP: 392px; HEIGHT: 100px” width=”488″>
<TR>
<TD style=”WIDTH: 167px” vAlign=”top” align=”center” colSpan=”1″ rowSpan=”1″><STRONG><FONT face=”Arial” size=”2″>&nbsp;<FONT face=”Verdana, Arial, Helvetica, sans-serif” size=”2″><STRONG><FONT face=”Arial” size=”2″>Net
rent Income<INPUT id=”Text8″ readOnly type=”text” name=”ri”></FONT></STRONG></FONT></FONT></STRONG></TD>
<TD style=”WIDTH: 157px” vAlign=”top” align=”center”><FONT face=”Verdana, Arial, Helvetica, sans-serif” size=”2″><STRONG><FONT face=”Arial” size=”2″>&nbsp;

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@MrNobodyFeb 15.2009 — All of these:
[CODE]document.Form1.arv.value[/CODE]
should be this:
[CODE]document.[COLOR="Red"]temps[/COLOR].arv.value[/CODE]
for cross-browser-functionality.
Copy linkTweet thisAlerts:
@web_bertFeb 15.2009 — You should also use a switch statement to save all the if statements, and you should create a var with the value of unescape(splitArray[i+1]).
Copy linkTweet thisAlerts:
@MrNobodyFeb 15.2009 — Neither of those changes will improve the efficiency or save on the performance of the code -- because, internally, the switch statement will use the same number of if-tests and only one of the [B]unescape()[/B] functions will ever execute. Those changes will only serve to slightly reduce the size of the document (because you also end up having to add a lot of [B]break[/B] statements for the [B]switch[/B] construct) and improve the readability and maintainability of the code. This is not to say that they aren't good changes to make. I'm just pointing out the actual effects of making these changes.
×

Success!

Help @googlegoo 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 5.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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