7

How do I open a link in a new window and set the size after loading the page?

 3 years ago
source link: https://www.codesd.com/item/how-do-i-open-a-link-in-a-new-window-and-set-the-size-after-loading-the-page.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

How do I open a link in a new window and set the size after loading the page?

advertisements

I have a link with querystring like "...com/default3.aspx?id=123?code=456" This link create automatically and sending in mail as a hyperlink. I design default3.aspx page and doing some operations according to querystring. Is that a way open this link in a new window and set window size, after clicked from mail this link?

I tried this but it doesn't work.

<body onload="resizeWindow()" >
...
    <script type="text/javascript">
    function resizeWindow()
   {
    // you can get height and width from serverside as well
    var width=100;
    var height=100;
    window.resizeTo(width,height);
    }
    </script>

Thank you.


Try to open window using window.open like window.open("", "", "width=200, height=100");

Check out sample code at W3Schools http://www.w3schools.com/jsref/met_win_open.asp

Check for demo using Try it yourself

Related Articles

How can I open a link in a new window (and all the following links in this same new window)?

I have an AngularJS app which I successfully got to segregate controllers for the hyperlinks to open windows and the target of the hyperlinks was successfully set as a new window. My problem is, how do I only allocate one and only one window to open

How do I open a link in a new window using css?

I need to make a set of links open in a new window - the good thing is they all have the same css style - what do i need to do in css to get these links opened in new window?As per the comments: and how can i specify window size? i want it a little s

Open a link in a new window in the server-side ajax panel

I have asked this question before, but got no answer that worked. This is a buttonclick event that should initiate the download: protected void btnDownload_Command1(object sender, CommandEventArgs e) { GridDataItem item = gvClients.Items[Convert.ToIn

How do I open a link in a new page in the button command in the item model in grid view?

I have one item template in grid view, which contains one link. I want while clicking that button it should open in a new tab like target= "_blank". <asp:TemplateField HeaderText="Reportd Link" ItemStyle-HorizontalAlign="center

With one click, I want to open the link in a new window and also 2 new tabs in the previous window

I want to open image link in new window and also 2 new tabs in previous window at a time . Kindly tell me how i can do this with html/java script code or whatever way ?just simply you should add javascript event on image link and use this code; <a id

Open a link in a new window

I'm using the following code to open the link in a new window, its working in IE8, Chrome and Opera, but in Firefox 6 it's opening in a new tab. How can I fix that? var popupName; function openPopup(href) { popupName = window .open( href, 'Details',

Selenium 2: Open the link in a new tab and close the tabs

I want to be able to open a link in a new tab in Selenium 2. Also i want to close the tab when i am finished interacting with the page. How is this possible if I have a WebElement of an <a> tag? I am using the Java API of Selenium 2 with the Firefox

Open a new window and pass the vb.net asp

Hi I have a web app which has a listbox of all the available reports for a particular user. I want to open a new page 'ReportViewerPane' when a row is clicked and pass the report name and some parameters through to the reportviewer.aspx I then need t

Open a new window and pass the collection to viewmodel using mvvm

I have a view which consists of a button when i click i want to open window in which i want to pass observable collection to viewmodel of the new window open.I am using below code it is working but i am not sure it is mvvm pattern or not. ViewCode: N

Visual Studio: Open a symbol source file before debugging and set the breakpoint

I have a project where the referenced assemblies have symbol files available. Both pdb, and the source files themselves. (they are all my own libraries). The symbols are all listed in the Tools / Options / Debugging / Symbol marking their locations.

How do I open a link to a new tab with the Print command?

I have a hyperlink with contains third party website link. I want to open this link in new tab with print command. How can i do this? Suppose: <a href="www.google.com" target="_blank">Print</a> Note: I know how to open a li

How do I open a link in a new tab (not a new window)?

This question already has an answer here: How to open link in new tab on html? 11 answers I have an 'Open' button that 'calculates' a link that should be opened in a new tab. I try to use: window.open(url, '_blank'); But that opens a new window. I al

How to open a link in a new tab (chrome) using the selenium Webdriver?

System.setProperty("webdriver.chrome.driver", "D:\\softwares\\chromedriver_win32\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); driver.manage().window().maxi

How to open a link in a new window?

I need to open a new link automatically inside if(isset($_POST['download'])) { ... } after user clicks on submit button download. I tried document.location, but it opens a link in the same tab, and window.open requires that the browser should have po

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK