/    Sign up×
Community /Pin to ProfileBookmark

IE – FF script problem

Hi All;

OVERVIEW:
I have a web page that is passed a string of data as a URL param.
Using javascript:
The data is grabbed decrypted and sliced into its constituent parts.
Each part is assigned to a variable.
The variables are then displayed in a form, awaiting posting on to a server side script for processing.

Using Firefox 1.5 everything is fine
Using IE the data displayed to the form consists of a string of “^^^^^^^^^^^^^^^^^^^^^^^^^^^” .

Are there any known issues in the way the two browsers handle Javascript?

I get the feeling this is to do with scope, but dont fully understand how one browser has no problems and the otherdoes.

Any initial thoughts?

I can post the code, but I’ll have to trim it down a bit first.

Regards
Adaman

I’m not a JavaSCript programmer (this is my first script nor very familiar with C/C++ – as my name indicates my joy is Ada – lol)

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@SelrachJan 30.2006 — Can you show us the script? Or a link to the page? Both browsers handle javascript...they just have their own idiosyncracies
Copy linkTweet thisAlerts:
@James_GatkaJan 30.2006 — Adaman:

Is this how you are "processing" the query string? This works in IE and FF.

homepage:

[CODE]<html>
<head>

</head>
<body>
<form method="get" action="Greeting.html">
First Name: <input type='text' size='15' name='fName' value='Thomas'><br>
Last Name: <input type='text' size='15' name='lName' value='Jefferson'><br>
<input type='submit' value='Submit'>
</form>
</body>
</html>[/CODE]


Greeting.html:

[CODE]<html>
<head>
<script type="text/javascript">

function processQuery(){

var names = location.search.substring(1,location.search.length).split('&');
var fName = names[0].substring(names[0].lastIndexOf('=')+1,names[0].length);
var lName = names[1].substring(names[1].lastIndexOf('=')+1,names[1].length);
var greetStr = "Hello " + fName + " " + lName;
document.getElementById('greeting').innerHTML = greetStr;
}

window.onload=processQuery;

</script>
</head>
<body>
<div id='greeting'>&nbsp</div>

</body>
</html>[/CODE]
×

Success!

Help @AdaMan 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.19,
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,
)...