homepage Welcome to WebmasterWorld Guest from 54.145.183.190
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
JavaScript Problem Help Guys!
jennashton

10+ Year Member



 
Msg#: 341 posted 8:47 pm on Apr 3, 2003 (gmt 0)

Hi,

I am working on a simple javascript quiz page. Instead of having poping up a new window/page to display the results, I would like it to be in the same window...below is my script. What should I do? I tried taking out the window.open part and wrote window.location that didn't work. Thanks guys!

<script>
function wizard()
{

url = '';

if (document.finder.radio0[0].checked) {
url = url + '1';
} else {
url = url + '2';
}

if (document.finder.radio1[0].checked) {
url = url + '1';
} else {
url = url + '2';
}

if (document.finder.radio2[0].checked) {
url = url + '1';
} else if (document.finder.radio2[1].checked) {
url = url + '2';
} else {
url = url + '3';
}

if (document.finder.radio3[0].checked) {
url = url + '1';
} else {
url = url + '2';

}

url = 'answer.html?' + url + '00';

//alert(url);

var win = window.open(url, 'Product');
win.focus();
return true;
}

</script>

 

korkus2000

WebmasterWorld Senior Member korkus2000 us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 341 posted 8:49 pm on Apr 3, 2003 (gmt 0)

So you tried exchanging

var win = window.open(url, 'Product');
win.focus();
return true;

for

window.location=url;

jennashton

10+ Year Member



 
Msg#: 341 posted 8:54 pm on Apr 3, 2003 (gmt 0)

you mean
window.location=url;
var win = window.open(url, 'Product');
win.focus();
return true;
?

or do i need to delte the window.open part.

Thanks,

Jenn

korkus2000

WebmasterWorld Senior Member korkus2000 us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 341 posted 12:03 am on Apr 4, 2003 (gmt 0)

Try exchanging the 3 lines for just the one.

var win = window.open(url, 'Product'); --> you don't want to open a new window or even stay on the page. No reason for a variable either.
win.focus(); --> No reason to focus only one window
return true; --> You not returning anything. You want to load a new page.

Delete these three lines and try putting

window.location=url;

I am not certain it will work I haven't tried it, but it would be where I would start.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved