leaflet problem with questionmark in anchor in bindpopup

22 lượt xem
Chuyển tới thư đầu tiên chưa đọc

ekevanb...@gmail.com

chưa đọc,
10:13:59 20 thg 4, 201420/4/14
đến leafl...@googlegroups.com
In Leaflet, the bindpopup chokes on a questionmark in an anchor.

It works fine as in .bindPopup('<a href="http://www.here.nl/page.php">tekst</a>');
but not in  .bindPopup('<a href="http://www.here.nl/page.php?nr=15">tekst</a>');
because it inserts a slash before the questionmark.

So when I click on the second anchor, the browser will look for
http://www.here.nl/page.php/?nr=15   <== mark the slash before the question mark
and not for
http://www.here.nl/page.php?nr=15

Is there anything I can do to prevent this insertion of a slash?

I am grateful for any help someone may give me.

Eke (EkevanB...@gmail.com)

k_man_au

chưa đọc,
00:01:57 24 thg 4, 201424/4/14
đến leafl...@googlegroups.com


Works fine for me.... some things you can try:-

Pass link in
             var linkurl = "http://www.here.nl/page.php?nr=15"
             .bindPopup("<a href='" + linkurl + "'>tekst</a>");

Be careful with your " vs ' you could try escaping the quotation mark... e.g.

              .bindPopup("<a href=\"http://www.here.nl/page.php?nr=15\">tekst</a>");

All else fails, escape the question mark \? :)
Trả lời tất cả
Trả lời tác giả
Chuyển tiếp
0 tin nhắn mới