AJAX with jQuery
AJAX with jQuery
Hi, i've been working with jQuery for about 1 month and i have a question about the right way of working AJAX with it. What i normally do when starting a new proyect is create a series of folder where i will put my files (ie.HTML/ for my .html, JS/ for my .js, CSS/ for my .css, IMAGE/ for all my .png,.jpg,.gif,etc. files and so on), and in my root folder i place a index.html file that the name says it all.
In this index.html file is where i put all my menu,etc. and where i put a DIV (ie. id=content) where i will load all the HTML pages (placed in my HTML/ folder) using the AJAX function in jQuery.
So
here is the moment of my question, whenever one of this html files has an image (ie. suppose this html file has <img src="../image/a.jpg"/>) what i normally do is that i change the source to (src="image/a.jpg") so when the index.html loads the page it references correctly to the image file, since the index.html file is in the root folder and the source of the image will be (image/a.jpg) and not (../image/a.jpg).
The problem with this is that i will not be able to preview my html files right since they will have the src of the images wrong, and the same applies to any flash or other kind of content that need to references another file.
So finally (and sorry if i was to long with this, it's just that i wanted to make myself clear), i want to ask everyone that reads this, is this the right way of approaching this? Am i doing this right or wrong? Thanks for any answer i may get!! And sorry if i wrote anything wrong.