By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,970 Members | 1,669 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,970 IT Pros & Developers. It's quick & easy.

netscape vs ie

P: n/a
I have the following function that works under netscape 7, but doesn't
work under ie. What changes should be made to make it run under ie?

function ButFunction()
{
var Page;
var s;
var d;
var h, w;

s = document.SrchForm.SearchDB.value;
d = document.SrchForm.DetailDB.value;
d = d - 1;

Page = "Table_Page.html?" + "sch=" +
document.SrchForm.SearchDB.options[s].text + "&" +
"dtl=" + document.SrchForm.DetailDB.options[d].text;
var newWindow = open(Page, "Records Selected", "fullscreen=yes");
}
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Terry A. Haimann" <te***@yngstr.oldboy.com> writes:
I have the following function that works under netscape 7, but doesn't
work under ie. What changes should be made to make it run under ie?
There are three things that you need to tell when you ask for help
with code that doesn't work:

1) What did you do? The code is a beginning, but how is it called?
What is on the page? What browser are you using (you said this one)?
2) What did you expect to happen? I.e., what was your intention. It
is hard to tell you what to change if we don't know the goal.
3) What really happened? "Didn't work" is not sufficient. We know
that, otherwise you wouldn't ask. Error messages, or their absence,
and any visible effect, or absence of it.
function ButFunction()
{
var Page;
var s;
var d;
var h, w;

s = document.SrchForm.SearchDB.value;
I prefer
s = document.forms['SrchForm'].elements['SearchDB'].value;
However, if it works in Mozilla/Netscape without these collections,
then it probably also works in IE.
var newWindow = open(Page, "Records Selected", "fullscreen=yes");


Most likely error: Window names are not allowed to contain spaces.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

P: n/a
Terry A. Haimann wrote on 19 Nov 2003:
I have the following function that works under netscape 7, but
doesn't work under ie. What changes should be made to make it
run under ie?

function ButFunction()
{
var Page;
var s;
var d;
var h, w;

s = document.SrchForm.SearchDB.value;
d = document.SrchForm.DetailDB.value;
d = d - 1;
What exactly are you trying to do here? The Select.options array
expects an numerical index, so unless the value of each option in the
select menu is its own index, your code below shouldn't work. If the
option values do contain their index, you've picked an awkward way of
doing things. This would probably be better:

var s = document.forms['SrchForm'].SearchDB.selectedIndex;
var d = document.forms['SrchForm'].DetailDB.selectedIndex--;

There's also no need for the separate decrement, and the values could
be a little more meaningful (if appropriate).

Note: Select.selectedIndex will return zero-based indexes, so using
the above means that the first option in the DetailDB menu cannot be
selected. In that case, 'd' would be -1 and that's out of range for
the Select.options array.
Page = "Table_Page.html?" + "sch=" +
document.SrchForm.SearchDB.options[s].text + "&" +
"dtl=" + document.SrchForm.DetailDB.options[d].text;
var newWindow = open(Page, "Records Selected", "fullscreen=yes");


'fullscreen' is not a valid feature for a window (not by my
references, anyway), and it has been said in this group many times
now that trying to manipulate the user's browser dimensions is a bad
idea.

'Records Selected' is invalid. Remove the space or replace it with an
underscore. A window name is the same as a frame name and must begin
with a letter, and only contain letters, digits, hyphens (-),
underscores (_), periods (.), and colons (:). However, if you refer
to a name that contains anything other than alphanumeric characters,
you should use the appropriate collection and "quote" the name (like
I did earlier, using document.forms).

You should also use window.open(...) to make the call to
window.open() less ambiguous, and to avoid accidentally calling
document.open().

Hope that helps,

Mike

--
Michael Winter
M.******@blueyonder.co.uk.invalid (remove ".invalid" to reply)
Jul 20 '05 #3

P: n/a
On Thu, 20 Nov 2003 00:39:43 +0100, Lasse Reichstein Nielsen wrote:
Most likely error: Window names are not allowed to contain spaces.


Yes that was the problem, Thx
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.