?
Solved

Send args using window.open()

Posted on 2014-01-26
1
Medium Priority
?
194 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 84

Accepted Solution

by:
Dave Baldwin earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
Suggested Courses

764 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