Use window.open("file2.html");
Syntax
var windowObjectReference = window.open(strUrl, strWindowName[, strWindowFeatures]);
Return value and parameters
windowObjectReference
A reference to the newly created window. If the call failed, it will be null. The reference can be used to access properties and methods of the new window provided it complies with Same origin policy security requirements.
strUrl
The URL to be loaded in the newly opened window. strUrl
can be an HTML document on the web, image file or any resource supported by the browser.
strWindowName
A string name for the new window. The name can be used as the target of links and forms using the target attribute of an <a>
or <form>
element. The name should not contain any blank space. Note that strWindowName
does not specify the title of the new window.
strWindowFeatures
Optional parameter listing the features (size, position, scrollbars, etc.) of the new window. The string must not contain any blank space, each feature name and value must be separated by a comma.
window.location.href = 'file2.html'
? – Pteridophyteid
then you need to preface theid
with a#
:$('#div1').load(/* ...other stuff... */);
– Swaim