/    Sign up×
Community /Pin to ProfileBookmark

JS / HTML problem opening a popup window

Hi,

in Javascript I use this very simple function to open a page in a popup window:

function popup(folder)
{
cuteLittleWindow = window.open(“../” + folder + “/contact.htm”, “littleWindow”, location=no,width=400,height=372″);
}

I call this function from two different pages in HTML:

[U]this one works fine:[/U]
<p><a href=”javascript:popup(‘francais’)”>Laissez votre message sur notre site</a> ou contactez nous sur <a href=”mailto:xxx”>xxx</a> </p>

[U]whereas this one does not:[/U]
<p><a href=”javascript:popup(‘anglais’)”>Leave your message on our site</a> or contact us on <a href=”mailto:xxx”>xxx</a> </p>

I really don’t see what causes the difference – javascript is running in a script file in a folder calles “js” – on the same level as that js-folder is a folder names “anglais” and another named “francais”, in both these two folders is a file named “contact.htm”. Spelling of folders and files has been checked and double checked.

Anyone an idea?

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@Kevin2Mar 13.2016 — Try this:
cuteLittleWindow = window.open("../" + folder + "/contact.htm", "littleWindow", [SIZE=5][COLOR="#FF0000"]"[/COLOR][/SIZE]location=no,width=400,height=372");
Copy linkTweet thisAlerts:
@PepijnKoopsauthorMar 14.2016 — Try this:
cuteLittleWindow = window.open("../" + folder + "/contact.htm", "littleWindow", [SIZE=5][COLOR="#FF0000"]"[/COLOR][/SIZE]location=no,width=400,height=372");[/QUOTE]


Thanks for your reply Kevin, and well noticed the missing quotes - unfortunately these quotes were not missing in my code, don't know how they got lost while copying into this forum (other quotes got lost too, in the e-mail-hyperlink, but that's because I erased the mail-adress and has nothing to do with the problem). By the way, without these quotes the script could not have functioned at all I suppose - such was not the case though.
Copy linkTweet thisAlerts:
@PepijnKoopsauthorMar 14.2016 — SORRY, SORRY, STUPID ME - forgot the js reference on the other html-page... Problem resolved! Thanks for all your reading!
Copy linkTweet thisAlerts:
@rootMar 14.2016 — Also when posting any code please use forum tags, see my signature...
×

Success!

Help @PepijnKoops 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 4.27,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...