How to open a new window from Google Maps iFrame? - iframe

I have created a Google Maps map that I included on a webpage, by following these steps:
click "Customize and preview embedded map"
adjust the preview
copy paste the URL under "Paste HTML to embed in website"
paste the copied code into our webpage (<iframe>)
Now when clicking an area that I have created within the map (draw a shape) the user is able to click a link that points to another page within our website. But, the problem is that the page opens in the same <iframe>, whilst it should open outside the <iframe>.
When adding attributes like target="_blank" or target="_top" the attribute is stripped away by Google when saving the maps. Hence my embedded Google Maps map is useless for my website visitors.
Does anybody know how to make sure the window is opened outside the <iframe>?

Have you tried using the base tag within the <iframe>?
<base target="_parent" />
See How to force link from iframe to be opened in the parent window.
Alternatively you could create a intermediary page that the Google Maps page can call with a URL in the querystring that then runs some JavaScript to redirect the parent page to the URL.

Related

Why is there a message in my analytics.google (Google Analytics 4) which says Data collection isn’t active for my demo website?

I have created a demo stream in https://analytics.google.com/.
Next in tag manager
I created a Google Tag Manager account, a container and a new tag with relative trigger .
Next I published my container.
I Installed the Google tag manually by pasting provided script:
I copied the script provided in workspace of tag manager, and paste them after Google Tag script and the second script as mentioned in photo in body:
in DebugView page of analytics.google and tagassistant.google I can see all the information which seems to be correct. however, why in the first picture I have the highlighted yellow message? If I click the button View Tag Instructions, it only shows the script I have already copied in my pages.

Open a link in a frame/lightbox

im using wordpress and want to add a link which open in a frame/lightbox. Cant find a small solution for that.
There should be no new window. Just a content box which appear inside the page where i am. I hope u know what i mean
That should be pretty easy using the Easy Fancybox plugin.
Citing the entry from the FAQ section of the plugin's page:
Can I display web pages or HTML files in a FancyBox overlay?
Yes. First, enable the iFrame option on Settings > Media. Then, in your post or page content create a link to any web page or .htm(l) file in your content. Then switch to the Text tab in the Classic Editor or to Edit as HTML (under More options in the block menu) in Gutenberg, find the link <a ... > tag and give it a class="fancybox-iframe" attribute.
Voilà !
Beware, though, that:
Note: Not all external web pages are allowed to be embedded in an iframe and may be blocked by a server response header or script. The result will be either an empty/blank light box or the target page “breaking out” of the light box and loading in the main browser tab.
And you'd probably face the same problem with any other iframe solution. So that would work better with locally served pages.

How to add background music in asp.net without bgsound and embed

How to add background music when a website loads for the first time without using embed and bgsound.I am using visual studio 2010 and these two are not supported in this.
I am developing website using master page and i want to use the code in master
page.
What is the best practice to to be able when I open my website and some music starts f sometime.I am not much expert in .net with c#.So finding some problem in it.
If browser also matters?
Regards,
suparna
Add the following code anywhere in the body of your HTML document to embed a music file and play it automatically when a visitor browses your website.
<audio src="music/yoursongname.mp3" autoplay="autoplay" loop="loop"></audio>
Change the "src" attribute so that it contains the path and filename of the music file that you want to embed.
Note: Add the "loop" attribute if you want the music file to play over and over

Prevent iframe from adding entries to browser's history with links inside a pdf document

I cannot figure out any way to prevent that behavior with hyperlinks inside a PDF document. Is there any way to achieve this?
We cannot replace iframe with object or embed tag.
# Jared Farrish: Nope, we want to prevent links in a PDF document being added to browser's history. For example, a PDF document is loaded in an iframe, it also contains links to other pdf documents. When users click on a link, new pdf one is loaded into target iframe, also an entry is added into browser's history. I need to prevent that.
#GolezTrol: Because it's the requirement, if you place it in an embed or object tag, when clicking on a links, your site will be redirected to another new pdf document. I need to load a new pdf document without navigating away the current web page.
At least in my test using FF4 and Chrome (latest), using a Javascript appendChild did not add it to the history.
var iframe = document.createElement('iframe');
iframe.src = "https://web3.unt.edu/riskman/PDF/UNTSafetyManual__Revised__3-2-06.pdf";
document.body.appendChild(iframe);
http://jsfiddle.net/ZML3u/

Catch a pdf hyperlink click from an iframe

I'm loading pdf's into an iframe on my web page by setting the src of the iframe to the path of the pdf document.
This works as I'd like for viewing the pdf.
The problem is that some of the pdf's have hyperlinks in them to external websites which, when clicked, load the external website in my iframe.
So my question is: is it possible to catch the pdf's hyperlink click in javascript in the parent browser window, set the target to either top or blank and then redirect the request?
Unfortunately the pdf's are supplied by a third party so I don't have access to change the documents themselves.
Some ideas:
You can try hooking into the iframe's load/readystatechange event to catch when the iframe is loading another url.
You can "poll" the iframe every n interval and compare the src attribute to the URL of the pdf.
After you catch the change, you can redirect and open a window with the proper url. But browsers may block the JS pop-up window.

Resources