0

Since I have mootools used on a web page, jquery conflicts with it so I'm attempting to traverse the following xml file.

<gallery>
 <album title="test" description="test" lgPath="/images/commphotos/">
<img src="1130975173.jpg" />
<img src="1475634985E.jpg" />
<img src="1889677107.jpg" />
<img src="1356256436.jpg" />
<img src="834682273.jpg" />

</album>
</gallery>

One I return the javascript file using a standard ajax call. How would I traverse it to get the image tags out. Using responseText when returning the xml? Can't use jquery. I have no idea how to do mootools.

Thanks

1 Answer 1

1

To solve the conflict, you can use jQuery instead of $. If $ is occupied by jQuery, use $.noConflict() prior continuing.

Then, use the answer at your previous question, by replacing $ by jQuery, or use:

var images = [];
jQuery(xml).find('img').each(function(){
    images.push(this.src);
})
Sign up to request clarification or add additional context in comments.

3 Comments

$.noConflict() is not a function
and i apologize i'm using responseXML on return..i have the xml file, just wondering how to traverse it
Then $ is not occupied by jQuery, but Mootools, as desired. Use jQuery(..) instead of $(...), as mentioned at my answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.