Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-14-2010, 09:39 PM   PM User | #1
artro1811
New to the CF scene

 
Join Date: Dec 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
artro1811 is an unknown quantity at this point
Exclamation How to make a configuration page?

Hello, first, I'm new here and I hope you can help me

The problem is that I'm making a script and I need to have the information of a website on the script which is in a different document.

The code of the website is similar to this:
Code:
<html>
<head>
<script type="text/javascript">
var name = prompt("Put here your name");
var surname = prompt("Put here your surname");
</script>
</head>
<body>
</body>
</html>
But I want to give the value of the name and surname to the vars of another script:
Code:
var name = "What I have to put here to get the info of the web?";
	var surname = "What I have to put here to get the info of the web?";
	
		document.getElementById("name").value = name;
		document.getElementById("surname").value = surname;
		document.getElementById("loginbutton").click();

Help please!
artro1811 is offline   Reply With Quote
Old 12-15-2010, 07:27 AM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,036
Thanks: 197
Thanked 2,411 Times in 2,389 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
JavaScript is purely a client-side language, and unless used with an Ajax call has no capability to read from or write to a file (except a cookie), communicate with the server, access a database, the client's operating system or the Windows registry, or alter the default behaviour of the browser. And for security reasons JavaScript cannot access anything beyond the domain of the current page. This is known as the "same origin policy" and prevents a document or script loaded from one origin from getting or setting properties of a document from a different origin.


All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.
Philip M is offline   Reply With Quote
Old 12-15-2010, 02:18 PM   PM User | #3
artro1811
New to the CF scene

 
Join Date: Dec 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
artro1811 is an unknown quantity at this point
Quote:
Originally Posted by Philip M View Post
JavaScript is purely a client-side language, and unless used with an Ajax call has no capability to read from or write to a file (except a cookie), communicate with the server, access a database, the client's operating system or the Windows registry, or alter the default behaviour of the browser. And for security reasons JavaScript cannot access anything beyond the domain of the current page. This is known as the "same origin policy" and prevents a document or script loaded from one origin from getting or setting properties of a document from a different origin.


All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.
So how can I do to make the prompts only in one web page?
For example, I want to get prompts on www.myname.com but not in the others sites.
How can I do?
artro1811 is offline   Reply With Quote
Old 12-15-2010, 03:21 PM   PM User | #4
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,036
Thanks: 197
Thanked 2,411 Times in 2,389 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
I don't really understand you, but JavaScript is not the answer. You need to use server-side scripting.
Philip M is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:57 PM.


Advertisement
Log in to turn off these ads.