[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 698
  • Last Modified:

javascript:poponload('main.htm');

I have two files
1.> main.html
2.> try-demo.html

From try-demo I am trying to open main.html. However I am getting an error in the javascript. Please evaluate my code below and let me know.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>JavaScript Popup Example 3</title>
 
<script language="JavaScript1.2" type="text/javascript">
function poponload(url)
{
testwindow= window.open(url, "Stock Navigator","location=0,status=0,scrollbars=0,menubar=0,toolbar=0,width=1024,height=768,left=0 top=0 fullscreen=1");
}
</script>
</head>
<body>
<a href="javascript:poponload('main.htm');">Demo</a>
</body>
</html>

Open in new window

0
jbajaj
Asked:
jbajaj
  • 4
  • 2
  • 2
1 Solution
 
Bill-HansonCommented:
Your parameter list is not fully comma separated.  Try this:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>JavaScript Popup Example 3</title>
 
<script language="JavaScript1.2" type="text/javascript">
function poponload(url)
{
testwindow= window.open(url, "Stock Navigator","location=0,status=0,scrollbars=0,menubar=0,toolbar=0,width=1024,height=768,left=0,top=0,fullscreen=1");
}
</script>
</head>
<body>
<a href="javascript:poponload('main.htm');">Demo</a>
</body>
</html>

Open in new window

0
 
erikTsomikSystem Architect, CF programmer Commented:
Ok you forgot to include single quotes . And it should look like this


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>JavaScript Popup Example 3</title>
 
<script language="JavaScript1.2" type="text/javascript">
 
 
function poponload(url)
{
window.open('url',null,
    "height=200,width=400,status=yes,toolbar=no,menubar=no,location=no");
}
 
</script>
 
</head>
<body>
 
<a href="javascript:poponload();">Demo2</a>
 
</body>
</html>

Open in new window

0
 
contactkarthiCommented:
as there menu and tool bars... replace the stocknavigator to null
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>JavaScript Popup Example 3</title>
 
<script language="JavaScript1.2" type="text/javascript">
function poponload(url)
{
testwindow= window.open(url,null,"location=0,status=0,scrollbars=0,menubar=0,toolbar=0,width=1024,height=768,left=0 top=0 fullscreen=1");
}
</script>
</head>
<body>
<a href="javascript:poponload('main.htm');">Demo</a>
</body>
</html>

Open in new window

0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
erikTsomikSystem Architect, CF programmer Commented:
MY code is working just fine . Checked it a million times
0
 
contactkarthiCommented:
>> erikTsomik

no need of single quote for url
0
 
Bill-HansonCommented:
>> contactkarthi

"Stock Navigator" is just the name given to this popup.  No need to null it.

The only problem with the original code above is the param list.
0
 
erikTsomikSystem Architect, CF programmer Commented:
it does need . check the syntax . And the code is working well
0
 
erikTsomikSystem Architect, CF programmer Commented:
Thank you for the points
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now