/    Sign up×
Community /Pin to ProfileBookmark

dynamic content not working in Netscape

Posted__08/25/2004_:_ 8:25:29 PM _ _ _ _ _
————————————————————————

I have a script that generates a headline dynamically. It’s working in IE but not NN. Here’s the code in question:

var clients = [”,’client1′,’client2′,’client3′,’client4′,’client5′,’client6′];
var hdrs = new Array(6);
____hdrs[0] = []
_
__
_hdrs[1] = [”,’Headline 1′,’Headline 2′,”,”,”,”];//client1
_
___hdrs[2] = [”,”,”,”,”,”,”];//client2
_
__
_hdrs[3] = [”,”,”,”,”,”,”];;//client3
_
___hdrs[4]____= [”,”,”,”,”,”,”];//client4
_
___hdrs[5] = [”,”,”,”,”,”,”];//client5
_
__
_hdrs[6] = [”,”,”,”,”,”,”];//client6
function writeHdr(hdr) {
var thisClient_
____= client;
_
__
_if (nn) {
_
_______var lyr = document.header.document
_
__
_____lyr.open()
_
__
_____lyr.write(‘<span class=”headText”>’+hdrs[thisClient][hdr]+'</span>’)
_
__
_____lyr.close()
_
__
_}
_
___else if (ie) document.all[‘header’].innerHTML = hdrs[thisClient][hdr];
}
function init() {
var thisClient_
__
__= client;
var thisLink__
___= ‘link0’+link;
var thisImage_
__
__= img;
var thisHdr__
___= hdr;
_
__
_document.lgHead.src = ‘images/head_s_‘+clients[thisClient]+’.gif’;
____document.lgImage.src = ‘images/port_bofa_lg’+thisImage+’.jpg’;
_
__
_eval(‘writeHdr(‘+thisHdr+’)’);


____

}

It appears in the HTML like this:
<div id=”header” class=”headText”></div>

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisAug 25.2004 — It would be better if you could post a link.

Your code snippet does not show where nn or ie are defined.
Copy linkTweet thisAlerts:
@nyc_courtneyauthorAug 25.2004 — Here's the entire page code:

<html>

<head>

<title></title>

<script language="JavaScript">

<!--

var thisPage=false;

nn = (document.layers)? true:false;

ie = (document.all)? true:false;

img = window.opener.page;

link = window.opener.page;

hdr = window.opener.page;

client = window.opener.client;

var clients = ['','client1','client2','client3','client4','client5','client6'];

var hdrs = new Array(6);

hdrs[0] = []

hdrs[1] = ['','Headline 1','Headline 2','','','',''];//client1

hdrs[2] = ['','','','','','',''];//client2

hdrs[3] = ['','','','','','',''];//client3

hdrs[4] = ['','','','','','',''];//client4

hdrs[5] = ['','','','','','',''];//client5

hdrs[6] = ['','','','','','',''];//client6

function writeHdr(hdr) {

var thisClient = client;

if (nn) {

var lyr = document.header.document

lyr.open()

lyr.write('<span class="headText">'+hdrs[thisClient][hdr]+'</span>')

lyr.close()

}

else if (ie) document.all['header'].innerHTML = hdrs[thisClient][hdr];

}

function init() {

var thisClient = client;

var thisLink = 'link0'+link;

var thisImage = img;

var thisHdr = hdr;

document.lgHead.src = 'images/head_s_'+clients[thisClient]+'.gif';

document.lgImage.src = 'images/port_bofa_lg'+thisImage+'.jpg';

eval('writeHdr('+thisHdr+')');

}

function linkStyle() {

// NOTE: the number in the line below must be one greater than the number of images for that client

for (i=1;i<3;i++) {

var thisLink = 'link0'+i;

//alert(document.lgImage.src);

//alert(window.name);

}
}

function nxtImg(img) {

var thisLink = 'link0'+img;

var thisImg = img;

document.lgImage.src = 'images/port_bofa_lg'+thisImg+'.jpg';

//alert(document.lgImage.src);
//alert(thisAdrs);


opener.location.href = 'wp047_port_bofa'+img+'.asp?spage=<%=strSpage%>';
}


//-->

</script>

<style type="text/css">

<!--

#header {position:absolute; left:20; top:42; width:200; height:30; clip:rect(0,200,30,0);}

-->

</style>

</head>

<body bgcolor="#FFFFFF" marginheight="10" marginwidth="20" topmargin="10" leftmargin="20" onload="init();preloadPortPop();">

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td align="left" valign="top"><img name="lgHead" src="images/spacer.gif" alt="" width="235" height="29" border="0"></td>

<td align="right" valign="top"><a href="javascript:window.close();" class="supNav">CLOSE WINDOW</a></td>

</tr>

</table>

<div id="header" class="headText"></div>

<div><img name="lgImage" src="images/spacer.gif" alt="" width="667" height="411" border="0"></div>

<div style="color:#666;font-size:10px;">&#169; 2004</div>

</body>

</html>
Copy linkTweet thisAlerts:
@gil_davisAug 25.2004 — What version of Netscape? You are only detecting NS 4.
×

Success!

Help @nyc_courtney 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.17,
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,
)...