Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhoneGap with Openlayers: popup which to redirect to another page get a error Uncaught ReferenceError: $ is not defined [closed]

I have a PhoneGap application use Openlayers to show local map. I use a popup to show information of location which appeared before by a marker. I append a link into this popup to redirect to another page, but i get a error "Uncaught ReferenceError: $ is not defined" when click popup to redirect. New pages still show but don't have any js library or css are loaded, so generating error "Uncaught ReferenceError: $ is not defined". I think all js libraries are no longer in the DOM when redirect from popup. I use Ajax to load other pages and add it to DOM, so I reference all js libraries in a first page is index.html. I redirect successful with other redirections in my application.

like image 543
Bahien Nguyen Avatar asked Dec 21 '25 15:12

Bahien Nguyen


1 Answers

Based on your code and our conversation, links generated outside JQM, won't be recognized by it. Thus, it essential to link jQuery and jQuery Mobile to the new link.

In your code, a link was generated by OpenLayer and not by JQM.

like image 159
Omar Avatar answered Dec 23 '25 10:12

Omar