Can someone share Javascript code to force links to open in a new browser window?
The link will be ad generated by Javascript code.
Here is a bit more detail about my situation. I am creating a web-based mobile app. In other words, the native app acts just like a set of frames that load web pages. One of the frames loads an ad. The ad is invoked via javascript provided by various mobile ad networks.
On the iPhone, we are noticing the ad loads within the ad frame inside the app, instead of spawning a new browser window. We would like to resolve this w/ javascript code that forces all links (specifically links generated via javascript) to open in a new browser window.
Right, my question is what that code would look like.
The ads are created via Javascript (e.g. like an AdSense ad). I feel like, w/ Javascript, I should be able to create some behavior tied to certain tags and/or actions that will make clicked links resolve in new windows.
Please let me know if my question is unclear and I can clarify. Thanks.
Is there Javascript that I can add into my HTML file to add the new window behavior (e.g. target=“_blank”) to the link being generated by the 3rd-party Javascript file?