Solved

Send args using window.open()

Posted on 2014-01-26
1
193 Views
Last Modified: 2014-01-26
Hi Experts,

I want to do this window.open('myPage.aspx?arg1=abc') but it does not work if I send the page only it will open but when I send a arg it does not. How do I send the arg.
0
Comment
Question by:DColin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39810351
You must have something else going on.  I made up this simple demo pages and they work fine with args attached.
Window Open Test Page 1 - save as 'wopenpg1.html'
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>Window Open Test</title>
<script type="text/javascript">
<!--
function nxtpg() {
window.open('wopenpg2.html?arg1=abc');
}
// -->
</script>
</head>
<body>
<h1>Window Open Test Page 1</h1>
<button type="button" name="test" value="Test" onclick="nxtpg()">Test</button>
</body>
</html>

Open in new window

Window Open Test Page 2 - save as 'wopenpg2.html'
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>Window Open Test</title>
<script type="text/javascript">
<!--
function nxtpg() {
window.open('wopenpg1.html?arg1=abc');
}
// -->
</script>
</head>
<body>
<h1>Window Open Test Page 2</h1>
<button type="button" name="test" value="Test" onclick="nxtpg()">Test</button>
</body>
</html>

Open in new window

0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question