/    Sign up×
Community /Pin to ProfileBookmark

Opener with mozilla

I can’t seem to get this code to work correctly in mozilla, all the others work fine. I’m trying to have it add a menu generated on the page that opens it. In mozilla it generates and error complaining about it.

[code=php]
Loading Maps…
<script type=”text/javascript”>
opener.focus();
opener.document.all.maps.innerHTML = ‘<label for=”map”>Map:</label><select name=”map”><%’code %></select><br />’;
window.close();
</script>[/code]

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@CharlesDec 31.2004 — Try:

[font=monospace]<script type="text/javascript">

opener.focus();

opener.document.getElementById('maps').innerHTML = '<label for="map">Map:</label><select name="map"><%'code %></select><br />';

window.close();

</script>[/font]
Copy linkTweet thisAlerts:
@IncaWarriorauthorDec 31.2004 — That made nothing work.

The error mozilla gives in the console is "opener.document.all has no properties"
Copy linkTweet thisAlerts:
@Warren86Dec 31.2004 — Try swapping the double and single quotes, and avoid multiple uses of "map":

<script type="text/javascript">

opener.focus();
opener.document.all.maps.innerHTML = "<label for='map'>Map:</label><select name='isMap'><%code%></select><br>";
window.close();


</script>
Copy linkTweet thisAlerts:
@CharlesDec 31.2004 — Post the URL.
Copy linkTweet thisAlerts:
@IncaWarriorauthorJan 01.2005 — http://www.strategyplanet.com/populous/newreview.asp is the opener page (choosing a map pack will open the new page)

http://www.strategyplanet.com/populous/mapsfrompack.asp is the page with the script
Copy linkTweet thisAlerts:
@pj59Jan 01.2005 — [i]Originally posted by IncaWarrior [/i]

[B]That made nothing work.



The error mozilla gives in the console is "opener.document.all has no properties" [/B]
[/QUOTE]
That happens simply because you didn't use Charles' snippet.

document.all is IE specific and would also work, if 'maps' was the name of your div instead of the id. Due to the fact that your opener doc has a div with an id="maps", Charles' suggestion would function if only you implemented it. This is what you are still using:

opener.document.all.maps.innerHTML = '<label for="map">Map:</label><select name="map">(a number of options here)</select><br />';

Regards PJ

Happy new year to everybody
Copy linkTweet thisAlerts:
@IncaWarriorauthorJan 01.2005 — Ah thank you, I must have messed up last time I tried it.
×

Success!

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