MQ is not defined

2 posts / 0 new
Last post
MQ is not defined


down votefavorite


I need to Load the mapquestapi on a button Load after adding i am getting error as MQ is not defined

Same thing is working when i am adding the script to the head but not working on button load. i.e, $('head').append();


$("#viewOnMap").click(function () {



var map ='map', {
layers: MQ.mapLayer() ---->>> MQ is not defined

MQ.geocode({ map: map })
.search('lancaster pa');


I would be glad if anyone can post a solution to this issue. Thanks in advanced.

Can you see the files loading
Can you see the files loading in the developer tools network tab successfully?   Is the geocode and/or map being loaded after the files are completely loaded? If the code above is run as is then the map is being created before the files are loaded. Create an event on the file load to run processes using those files.