troubleshooting Question

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

Avatar of trevor1940
trevor1940 asked on
JavaScriptjQuery
2 Comments1 Solution439 ViewsLast Modified:
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
Jon Norman
Information Systems Manager
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros