javascript - Open a href link in the same pop up window -


i working on pop window displays list of store locations. each location there links google maps(maps , directions).

my question that, when click on maps , directions link, open google map on same pop window, have button @ end take me previous window. right now, every time, click on maps , directions, opening in browser window.

@charlietfl. ok. have product page link check store availability. when click on link, use jquery dialog open new pop dialog box. jsp page. in page, have search text can search list of stores zipcode. on search, ajax call, list of stores json , display them on jsp. each stores there link maps , directions take me google maps.

for example <a href="http://maps.google.com/?q=1200 pennsylvania ave se, washington, district of columbia, 20003" id="mapdirections_0" target="_self">map & directions<a>. aim when user clicks on link, map displayed on same pop jsp.

any appreciated. let me know if can provide more information.

thanks.

for popup windows, should use window.open method. question, have specify second parameter (name) when window.open() call.

window.open(url,name,specs,replace) 

see: http://www.w3schools.com/jsref/met_win_open.asp

i'll attach bit of code :

<!doctype html> <html lang="en"> <head>     <meta charset="utf-8">     <title>document</title>     <script>      function pop1(){         window.open('http://stackoverflow.com','popwin','width=640, height=480');     }      function pop2(){         window.open('http://google.com','popwin','width=640, height=480');      }      </script> </head> <body>     <a href="#" onclick="pop1()">open first</a><br>     <a href="#" onclick="pop2()">open second</a>     </body> </html> 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -