Jump to content

Search the Community

Showing results for tags 'window.open'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 3 results

  1. I came across a very odd issue in a project and hope someone here would have some insight into WHY this is happening... Have googled for days and can't find this issue anywhere, but I find it hard to believe no one has come across it before... We have a webpage (asp) which can result in a dynamic length, and we need to find out what the length of any particular presentation of this page is. Normally, this would be very simple by using the onload body.scrollHeight value. In fact, when the page is loaded in a pop-up using window.open, the value of the scrollHeight is accurate. If we print the page, we can convert to mm using the formula sH / 96 *254 adjusting for a 96dpi resolution and 254mm/inch. The value in this formula is spot on every single time, accurate to within 1mm. BUT... when the exact same page is loaded using the window.showModalDialog method, the scrollHeight values reported are different - and not in any mathematically consistent way. It is the same page and should have the same body.scrollHeight onload!! Here are three examples of actual measured page length compared to the loading method and resulting scrollHeight: measurement sH .open method sH .showModal Dialog method 952mm 360 px 344 px 1302mm 490 px 493 px 1682mm 661 px 637 px BOTH methods are being called without any menus, scroll, or other adornment. The browser is IE in all cases, with the same printer for measured output of course. The ONLY difference in the reported values is coming from the method being used to load the page. Needless to say, this is driving me nuts :-). Anyone have any ideas??? Thanks!
  2. Hello, I am relatively new to javascript although I have used some over recent years in my html web pages. I have a specific problem in which I have a form with an input box that I must validate as true or false. This part works. The call to another javascript will only work if tagged as target="_blank". I want to open the new url in the same window and nothing I have found on internet has worked. Here is my code: <script type="text/javascript"> function gotoProductWebPage() { var answer = document.getElementById("answer").value; if(answer==8){ nowbaby(); return true; } else { alert("Check your Math"); return false; } } </script> <Script type="text/javascript"> function nowbaby() { window.open ("myurl,"_self",false); }​ and here is the call from form: <form method="get" name="myname" onsubmit="gotoProductWebPage()">​ and here is html snippet: <p style='color:blue;text-align:center' > Enter answer to prove you are human. A=3, B=5, A+B=<input type="number" id="answer" size="6" name="answer" /><br /> </p> <p align='center' > <input type="submit" name="Submit" value="Submit" /> </p>​ Like I said, if I make it _blank it will open in new window, but for the life of me, I cannot get it open in same window. I have tried: window.location.href = "myurl" window.open("myurl/pid='0000","_self") location.ref and nothing seems to work. I am stumped. Please Help. I am working in IE and Edge, sorry should have referenced that.
  3. I have created a web page with a table. in each cell is an <img> inside an <a>. The init function writes the image tags in with the corect src values for each pic. It also writes the href values for the a tags. The idea is that when the pic is clicked it opens in a new window bigger using imageFunc to take the url which is the existing href, and show it in a new window. . I have a previous effort that does this fine but was done longhand by writing all the href's and src's in then adding 20 onclick events. This is my attempt to condense the whole thing into Js functions. Problem is this opens the image full screen in the existing tab. Which is ok but not what is supposed to happen. i have tried various settings for the parameters to no avail. I cant upload the .js so I have copied it in below; sorry. Any ideas will be appreciated. function init(){ for(i=1;i<21;i++) { x=document.getElementById("pic"+i); x.innerHTML="<img src='Weymouth by steam 2012 0"+i+".jpg' />"; document.getElementById("pic"+i).setAttribute("href","Weymouth by steam 2012 0"+i+".jpg");}}document.addEventListener("DOMContentLoaded", init, false); function imageFunc(){ a = document.getElementByTagName("a").getAttribute("href"); window.open(a.href, "_blank",'left=20,top=20,width=500,height=500,toolbar=0,resizable=1, scrollbars=yes');return false; } index.html weymouth2.css
×
×
  • Create New...