/    Sign up×
Community /Pin to ProfileBookmark

IE Problem with prompt()?

I’ve been doing a lot of development in PHP+JavaScript and I’ve been using Firefox on OS X to test. I had some free time in school recently so I tried it on IE/WinXP. I’m come across a huge problem… does IE not handle prompt() the same way as Firefox!? I found the documentation for prompt the on Google and I never saw any IE-only notes. Here’s some code…

[CODE]
var newValue = prompt(‘Enter new value for C_Name’, ‘Name1’);
window.location = “/register2/dcs2.php?C_Name=”+newValue+”&PHPSESSID=f525dfa32b4edf1b96f15de3467910a6”;[/CODE]

That’s generated dynamically. Anyway, on Firefox, I enter a new value and click OK and the page reloads with the URI equal to the window.location. In IE, when I click OK, nothing happens, the browser just sits there.

Anyone have any idea what’s going on?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@bathurst_guySep 21.2005 — yeh the problem lies not with the prompt, but with the window.location. I like for ie its document.location, its been a while since i used it though. why not just use php to do this though and forget about the js
Copy linkTweet thisAlerts:
@leadedauthorSep 21.2005 — I would love to do it in all PHP, but using JavaScript is easy for making individual edits. I'll try the way you mentioned tonight. Thanks!
×

Success!

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