LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-08-2012, 12:34 PM   #1
ShaqDiesel
Member
 
Registered: Jul 2005
Posts: 144

Rep: Reputation: 15
window.location.href


Hi, I am doing window.location.href=<url> followed by an alert("hello") and then a document.getElementsByTagName('a'). It navigates to the url, but no alert box comes up and I am unable to get the elements on the new page. What is going on? Thanks.
 
Old 08-08-2012, 12:46 PM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,871
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
The same as in the previous topic: the new page replaces the old one (and replacing includes deleting).
Plus, it would be a security hole to be able to access another website's elements. (Just think of net-banking: you don't want your private data stolen.)
 
Old 08-08-2012, 12:49 PM   #3
ShaqDiesel
Member
 
Registered: Jul 2005
Posts: 144

Original Poster
Rep: Reputation: 15
so how do i perform operations on the new page?
 
Old 08-08-2012, 01:04 PM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,871
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
By adding javascript into the new page, obviously. If it someone else's page, then it is a good thing you cannot manipulate it from your code. (Read my prev post.)
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Blackbox - Window maximization and initial location zampano Linux - Software 0 04-08-2012 01:18 AM
Application startup - default window location sabatier Linux - Software 1 09-22-2007 06:49 PM
x window directory location jestevan Linux - Newbie 1 05-17-2005 11:55 PM
Eterm window location aeruzcar Linux - Software 3 10-10-2004 05:22 PM
location.href behaviour on Linux? vonmugel Linux - General 0 07-22-2004 10:43 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration