Skip to main content

User login

What is OpenID?
  • Log in using OpenID
  • Cancel OpenID login
  • Create new account
  • Request new password
Register
  • Home
  • Browse
    • 2D Art
    • 3D Art
    • Concept Art
    • Textures
    • Music
    • Sound Effects
    • Documents
    • Featured Tutorials
  • Submit Art
  • Collect
    • My Collections
    • Art Collections
  • Forums
  • FAQ
  • Leaderboards
    • All Time
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
    • Weekly
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
  • ❤ Donate
Programming

simple javascript question

deedee123
Monday, September 4, 2017 - 12:18

I have a static html page that will open an other static html page in a _blank new browsertab. Is there an easy way to hand over a certain variable value to a script in the second file?

 

I know I could access self.parent.variablename if the new page was opened by window.open. But it's opened by <a href> (window.open is a popup, which I don't want to rely on). Isn't there any support vor variables in the URL? thanks.

  • Log in or register to post comments
MedicineStorm
joined 12 years 8 months ago
Monday, September 4, 2017 - 18:19
MedicineStorm's picture

Is accessing the GET variables through window.location.href an option?

--Medicine Storm

 

  • Log in or register to post comments
deedee123
joined 7 years 8 months ago
Tuesday, September 5, 2017 - 16:36

works perfectly, thanks! tested local access and apache over localhost in opera, not expecting problems with other browsers.

Calling http://www.myserver.com/test.html?someparameter

does load the page, just like

Calling http://www.myserver.com/test.html

 

only.

In the file tho, a document.write(window.location.href);

shows the entire URL, including the parameter.

And now to process this string in js is easy.

 

Thanks!

 

 

  • Log in or register to post comments
MedicineStorm
joined 12 years 8 months ago
Tuesday, September 5, 2017 - 16:45
MedicineStorm's picture

Glad that was helpful. Welcome to OGA. :)

--Medicine Storm

 

  • Log in or register to post comments