javascript - jQuery Plugin 101 -


i new this, after searching tutorials etc. don't understand why (and every single other jscript plugin have pasted in code*) isn't working.

*both within html , in separate js file...

<html> <head>  <link rel="stylesheet" type="test/css" href="stylesheet.css"/>  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> </head>  <body> <div class="imgcontent"><div id="map"><script type="text/javascript"> $('#map').mobilymap({     position: 'center', // map position after loading - 'x y', 'center', 'top left', 'top right', 'bottom left', 'bottom right'     popupclass: 'bubble',     markerclass: 'point',     popup: true, // show popup on marker click - true/false     cookies: true, // remember last map position - true/false     caption: true, // show caption - true/false     setcenter: true, // sets map view center on marker click     navigation: true, // display buttons pan in 4 directions     navspeed: 1000, // speed of panning map (higher value slow panning)     navbtnclass: 'navbtn',     outsidebuttons: false, // selector, anchors eg. '.map_buttons a'     onmarkerclick: function(){}, // call function on marker click (popup must disabled)     onpopupclose: function(){}, // call function after popup closing     onmapload: function(){} // call function after loading map }); </script></div></div> </body> </html> 

they haven't looked , have tried them locally , on server, recurring theme none of them working (map plugins).

rest assured know i'm missing fundamental, don't know is!

you placed script tag within element you're trying modify. move script tag after map div:

<div class="imgcontent">     <div id="map">     </div>     <script src="path/to/your/scripts/mobilymap.js"></script>     <script>     $('#map').mobilymap({         position: 'center', // map position after loading - 'x y', 'center', 'top left', 'top right', 'bottom left', 'bottom right'         popupclass: 'bubble',         markerclass: 'point',         popup: true, // show popup on marker click - true/false         cookies: true, // remember last map position - true/false         caption: true, // show caption - true/false         setcenter: true, // sets map view center on marker click         navigation: true, // display buttons pan in 4 directions         navspeed: 1000, // speed of panning map (higher value slow panning)         navbtnclass: 'navbtn',         outsidebuttons: false, // selector, anchors eg. '.map_buttons a'         onmarkerclick: function(){}, // call function on marker click (popup must disabled)         onpopupclose: function(){}, // call function after popup closing         onmapload: function(){} // call function after loading map     });     </script> </div> 

your markup shown has no script reference whatever mobilymap plugin is, problem. looks abandoned plugin, though there few projects use script open source, one: http://code.google.com/p/jqwicket/source/browse/trunk/jqwicket/src/main/java/com/google/code/jqwicket/ui/mobilymap/js/mobilymap.js?r=369


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -