Link to home
Start Free TrialLog in
Avatar of trevor1940
trevor1940

asked on

Jquery Creating object from a Link and where to put the code

Hi

Have two Jquery questions

first is it possible to create a object from link to jpg's where the text on the link is image?
for instance

a link
<a href="myPic.jpg>Image 1</a>

jquery object

$("a > href > /image/i").each(function(){
 if(!($this).parent("td"))
    {
      $(a")atrr("class", "fanceybox"     }


});
all other links add

$(a")atrr("target", "blank");

Then for links within a table how might i check that $(a")atrr("target", "blank"); hasn't been set or remove it if it has?


My second question is should the jquery script be within the head of the document or can you share the same script by creating a link the same as you would any other javascript eg

<script type="text/javascript" src="/js/my-jquery.js"></script>

i ask this because all the jquery scripts i've seen are either in the head or embeded within the document body.
ASKER CERTIFIED SOLUTION
Avatar of Jon Norman
Jon Norman
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of trevor1940
trevor1940

ASKER

thanx