Getting image by source with special characters
Hello,
I'm trying to get some images on my page by their src attribute. Src attribute have this format :
src = http://localhost:8888/mapviewer/mcserver?request=gettile&format=PNG&zoomlevel=0&mapcache=MAPNAME&mx=0&my=0
For doing that I'm using the following query :
$j("img[src*='request=gettile'][src*='"+$j(this).data("target")+"']")
$j(this).data("target") contains my mapname, it works fine.
But my users can use mapname that can be contained in another map names. Example : mapblabla and pbla. When I'm searching pbla it's returning images of mapblabla and pbla. That's why I need to put the symbol equal before and the symbol & after my map name. Then the request is :
$j("img[src*='request=gettile'][src*='\\="+$j(this).data("target")+"\\&']")
But the escaping seems to doesn't work, any idea where I did a mistake ?