views:

28

answers:

1

I'm in a bit of a rut. I need to figure out how to convert all this code into jquery. Since I don't know too much jquery. http://www.lastyearsloss.com/store/javascript/map.js I'm not sure which lines I can use or which ones change fully. The main problem is where I'm importing the data from xml. If anyone can point me in the right direction that would be awesome! thanks!

A: 

How will jQuery fix your importing of data? jQuery is still Javascript, just with shortcuts. It may make your code shorter to help you fix your problem;

from

var sidebar = document.getElementById('sidebar');
sidebar.innerHTML = '<p class="caption">No results found.</p>';
var div = document.createElement('li');

to

var sidebarJquery = $('#sidebar')
                      .html('<p class="caption">No results found.</p>');
var divJquery = $('<li/>');

A jQuery object is basically an Array of DOM elements, (with some additional methods), so:

var sidebar = sidebarJquery[0];
var div = divJquery[0];
Jerome
To be honest youre right it would be a huge waste of time, this thing is I'm trying to link the markers generated after a search to, when clicked change the background of the selected data in the sidebar http://www.trytyku.com/store_BACKUP/
Robert