Thursday, 15 March 2012

javascript - How to open Google Maps links in a pop up window? -


I am developing a mobile web app with jQuery + Phonegap which uses Google Maps API v3 and gives me some Problems are coming with links to Mac.

My question is, instead of opening rules and conditions and leaving a Google Maps link, instead of moving them to a window, such devices on the pop-up window that do not have physical buttons like Apple I have tried to attach a 'click' event to the elements of the map canvas child and to change their goal, but I am not able to achieve this. Is there a solution?

Thank you.

In both of those links, target = "_ blank" Should open them in a new window, for example the Google Maps link looks like this:

  & lt; One target = "_ blank" href = "http: //maps.google.com/maps? ..." title = "Click to view this area on Google Map" style = "status: constant; overflow: Visible; Float: None; Display: Inline; "& Gt; & Lt; Div ... & gt; & Lt; Img ... & gt; & Lt; / Div & gt; & Lt; / A & gt;   

But it seems that PhoneGrap is overriding the behavior as you mentioned in the comment. In fact if you search for the following:

  phonegap target_blank   

You will find a lot more specifically on the topic.

It seems that people want that they use phonegaps, but this is specifically tied in the window.open () function. You use these & lt; to use a window.open () call instead of a simple URL. A & gt; You can try changing href in elements.

For example, if you type ; If there are references to any one of the variables called link , then you can try:

  link.href = "javascript: window .open ('"+ link.href +"', '_blank', 'location = yes'); ";   

This changes in href :

  http://google.com/etc.etc.   

(In fact, all on one line, formatted here for readability):

  javascript: window.open ('http://google.com / Etc.etc. ',' _blank ',' location = yes');    

Another possibility is rel = "external" at and lt; A & gt; The tag and a change in technology can be MainViewController . But it dislikes and requires an equal amount of negligible with DOM elements.

Another thought ... Generally, these maps and tos can be sharpened with the internal workings of the link, its violation can be considered the terms of service. However, I think that you can easily argue that you are protecting the original intentions of these links against the PhoneGap issue only, which prevents them from working properly.

No comments:

Post a Comment