I have the following two ways suggested to me.
window.location.href = '/Administration/Notes/Create?dsValue=a&selectAnswer=b';
$.get("/Administration/Notes/Create", { dsValue: dsValue, selectedAnswer: answer });
Are these methods the same? Which one would be the best for me to use and what's the difference between the two?
To open a new window, use a keyboard shortcut: Windows & Linux: Ctrl + n. Mac: ⌘ + n.
The href attribute set to the URL of the page you want to link to. The target attribute set to _blank , which tells the browser to open the link in a new tab/window, depending on the browser's settings. The rel attribute set to noreferrer noopener to prevent possible malicious attacks from the pages you link to.
This works:
myWindow = window.open('http://www.yahoo.com','myWindow', "width=200, height=200");
It's not really something you need jQuery to do. There is a very simple plain old javascript method for doing this:
window.open('http://www.google.com','GoogleWindow', 'width=800, height=600');
That's it.
The first arg is the url, the second is the name of the window, this should be specified because IE will throw a fit about trying to use window.opener
later if there was no window name specified (just a little FYI), and the last two params are width/height.
EDIT: Full specification can be found in the link mmmshuddup provided.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With