Sorry, Noli, I just knew that the $ was a common conflict between jQuery and prototype, and to get them to behave together you had to use the noconflict function...<br><br><div class="gmail_quote">On Sat, Jun 25, 2011 at 6:12 PM, Noli Sicad <span dir="ltr"><<a href="mailto:nsicad@gmail.com">nsicad@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I think the jQuery no conflict function could not be apply in this<br>
case, since I am using jQuery mobile framework + Scrollview extension.<br>
<br>
<a href="http://jquerymobile.com/" target="_blank">http://jquerymobile.com/</a><br>
<br>
Just image changing all the $ to $j in jQuery Mobile framework, just<br>
to make (OpenLayers.Util.getElement("inproj").value) working,<br>
<br>
var $j = jQuery.noConflict();<br>
<br>
Any other possible solution to get Util.js working in jQuery mobile.<br>
<font color="#888888"><br>
Noli<br>
</font><div><div></div><div class="h5"><br>
On 6/25/11, Noli Sicad <<a href="mailto:nsicad@gmail.com">nsicad@gmail.com</a>> wrote:<br>
> Thanks Nick for this info.<br>
><br>
> Now, I have to replace $ into $j,<br>
><br>
> var $j = jQuery.noConflict();<br>
><br>
> I will try this option and see what happen.<br>
><br>
> Now, how extended the use of prototype in OpenLayers?<br>
><br>
> Is only Util.js uses prototype.js in OpenLayers?<br>
><br>
> I saw OpenLayers.mobile.js uses as well Prototype.<br>
><br>
> Noli<br>
><br>
> On 6/25/11, Nick Kendall <<a href="mailto:n.e.kendall@gmail.com">n.e.kendall@gmail.com</a>> wrote:<br>
>> Try the jquery no conflict function<br>
>><br>
>> <a href="http://docs.jquery.com/Using_jQuery_with_Other_Libraries" target="_blank">http://docs.jquery.com/Using_jQuery_with_Other_Libraries</a><br>
>><br>
>> Sent from my mobile device<br>
>><br>
>> On Jun 24, 2011, at 8:23 PM, Noli Sicad <<a href="mailto:nsicad@gmail.com">nsicad@gmail.com</a>> wrote:<br>
>><br>
>>> Hi,<br>
>>><br>
>>> I am having problem executing this updateFormats function (below)<br>
>>> which contains (OpenLayers.Util.getElement(......).value) in my jQuery<br>
>>> mobile OL. The updateFormats is demonstrated in vector formats, in<br>
>>> projection and out projection. My select controls are getting back<br>
>>> when I clicked it.<br>
>>><br>
>>> <a href="http://openlayers.org/dev/examples/vector-formats.html" target="_blank">http://openlayers.org/dev/examples/vector-formats.html</a><br>
>>><br>
>>> It seems that the problem is probably in the<br>
>>> OpenLayers.Util.getElement(......) which a $.<br>
>>><br>
>>> In Util.js,<br>
>>><br>
>>> ~~~~~~~~<br>
>>> OpenLayers.Util.isElement = function(o) {<br>
>>> return !!(o && o.nodeType === 1);<br>
>>> };<br>
>>><br>
>>> /**<br>
>>> * Maintain existing definition of $.<br>
>>> */<br>
>>> if(typeof window.$ === "undefined") {<br>
>>> window.$ = OpenLayers.Util.getElement;<br>
>>> }<br>
>>> ~~~~~~~~<br>
>>><br>
>>> Is this intervening in jQuery? Could I delete this? What would be the<br>
>>> solution inorder that updateFormats will be executed properly?<br>
>>><br>
>>> Thanks in advance.<br>
>>><br>
>>> Regards, Noli<br>
>>><br>
>>> ~~~~~~~~~~~~~~~~~~~~~~~<br>
>>><br>
>>> This updateFormats in jQuery.<br>
>>><br>
>>><br>
>>> #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
>>> $(function() {<br>
>>><br>
>>> function updateFormats() {<br>
>>><br>
>>> alert("updated!");<br>
>>><br>
>>> var in_options = {<br>
>>> 'internalProjection': map.baseLayer.projection,<br>
>>> 'externalProjection': new<br>
>>> OpenLayers.Projection(OpenLayers.Util.getElement("inproj").value)<br>
>>><br>
>>><br>
>>> };<br>
>>> alert(in_options);<br>
>>> var out_options = {<br>
>>> 'internalProjection': map.baseLayer.projection,<br>
>>> 'externalProjection': new<br>
>>> OpenLayers.Projection(OpenLayers.Util.getElement("outproj").value)<br>
>>> };<br>
>>> var gmlOptions = {<br>
>>> featureType: "feature",<br>
>>> featureNS: "<a href="http://example.com/feature" target="_blank">http://example.com/feature</a>"<br>
>>> };<br>
>>> var gmlOptionsIn = OpenLayers.Util.extend(<br>
>>> OpenLayers.Util.extend({}, gmlOptions),<br>
>>> in_options<br>
>>> );<br>
>>> var gmlOptionsOut = OpenLayers.Util.extend(<br>
>>> OpenLayers.Util.extend({}, gmlOptions),<br>
>>> out_options<br>
>>> );<br>
>>><br>
>>> var kmlOptionsIn = OpenLayers.Util.extend(<br>
>>> {extractStyles: true}, in_options);<br>
>>> formats = {<br>
>>> 'in': {<br>
>>> wkt: new OpenLayers.Format.WKT(in_options),<br>
>>> geojson: new OpenLayers.Format.GeoJSON(in_options),<br>
>>> gml2: new OpenLayers.Format.GML.v2(gmlOptionsIn),<br>
>>> gml3: new OpenLayers.Format.GML.v3(gmlOptionsIn),<br>
>>> kml: new OpenLayers.Format.KML(kmlOptionsIn)<br>
>>> },<br>
>>> 'out': {<br>
>>> wkt: new OpenLayers.Format.WKT(out_options),<br>
>>> geojson: new OpenLayers.Format.GeoJSON(out_options),<br>
>>> gml2: new OpenLayers.Format.GML.v2(gmlOptionsOut),<br>
>>> gml3: new OpenLayers.Format.GML.v3(gmlOptionsOut),<br>
>>> kml: new OpenLayers.Format.KML(out_options)<br>
>>> }<br>
>>> };<br>
>>> }<br>
>>><br>
>>> $('#inproj, #outproj').change(updateFormats);<br>
>>> }); // for the function<br>
>>> _______________________________________________<br>
>>> Users mailing list<br>
>>> <a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
>>> <a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
>><br>
><br>
</div></div></blockquote></div><br>