Newbie:Anybody can correct this?

P

Patrick

Hi guys

I am still learning the abc's of javascript going through many online
tutorials.The one i am currently checking out shows you how to change
properties in a child window from the parent window using radio
buttons.
It all sounds good but it doesn't work.I checked his source but can't
figure out what's wrong.Also his child window isn't retaining focus
when the radio buttons are clicked(His source shows focus in his code
too.).
If you want to give it a try at figuring out what's wrong, here is the
URL.
Just do the tutorial and click on the button, then click on the color
radio buttons on the parent window (It takes 3 minutes).

http://www.javascriptkit.com/javatutors/window5.shtml

I know i should email the author but having corrected 3 tutorials
already with minor mistakes and never got answers to my emails from
author, i chose to post here where i always get answers.

Thanks a lot

Patrick
(e-mail address removed)
 
I

Ivo

Patrick said:
Hi guys

I am still learning the abc's of javascript going through many online
tutorials.The one i am currently checking out shows you how to change
properties in a child window from the parent window using radio
buttons.
It all sounds good but it doesn't work.I checked his source but can't
figure out what's wrong.Also his child window isn't retaining focus
when the radio buttons are clicked(His source shows focus in his code
too.).
If you want to give it a try at figuring out what's wrong, here is the
URL.
Just do the tutorial and click on the button, then click on the color
radio buttons on the parent window (It takes 3 minutes).

http://www.javascriptkit.com/javatutors/window5.shtml

The onclick in the button looks like this:
onclick="win1=open('http://javascriptkit.com/page2.htm','winname','width=200
,height=200')"

Since http://www.javascript.com and http://javascript.com are different
domains, the browser hits an "access denied" error. Security restrictions
prohibit cross-domain scripting. Accessing the page without "www." solves
the problem.
HTH
Ivo
I know i should email the author but having corrected 3 tutorials
already with minor mistakes and never got answers to my emails from
author, i chose to post here where i always get answers.

Brilliant. Shame on those who don't reply.
 
P

Patrick

The onclick in the button looks like this:
onclick="win1=open('http://javascriptkit.com/page2.htm','winname','width=200
,height=200')"

Since http://www.javascript.com and http://javascript.com are different
domains, the browser hits an "access denied" error. Security restrictions
prohibit cross-domain scripting. Accessing the page without "www." solves
the problem.
HTH
Ivo

Hi

I can only say "Wow!" at you figuring this out.I guess i have a long
way to go before i reach a level like yours.I guess experience will
make perfect.
Thanks a lot Ivo for figuring it out for me.

Regards

Patrick
 
L

Laurent Bugnion, GalaSoft

Hi,
Since http://www.javascript.com and http://javascript.com are different
domains, the browser hits an "access denied" error. Security restrictions
prohibit cross-domain scripting. Accessing the page without "www." solves
the problem.

This problem is described at
<URL:
http://devedge.netscape.com/library/manuals/2000/javascript/1.3/guide/sec.html#1015705>

It can be solved by setting
document.domain = "javascript.com";
in the document at www.javascript.com.

Same here ;-)

Laurent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top