0

Basically Im working with Sharepoint, help me god!

Sharepoint does some crazy the things but Im hoping what I want to do can be achieved using jQuery.

Sharepoint is writing some image values into a table:

  <script>
    fNewItem = false;
    InsertItem("http://dev_site/sites/Pictures/Waves.jpg",  
    "5", 
    "BlueWaves",
    "jpg", 
    "1920", 
    "1080",
    "/_layouts/images/icjpg.gif", fNewItem);
  </script>

There are a number of these output by Sharepoint, this snippet is from a Sharepoint Gallery so I'd need to loop through the page to find all of these so that I can grab all of the images.

What I want to know is if there is anyway for me to grab these values using jQuery and then output them again?

1
  • Would it work to iterate over the images in the table once added? Commented Mar 29, 2011 at 16:24

1 Answer 1

1

You can use this code (LIVE DEMO) ... you may need to tweak the if() statement a bit to determine which <script>..</script> blocks you want to deal with or not.

$('script').each(function(){
    var t = $(this).text();
    if (t.indexOf('fNewItem')>0 && t.indexOf('CDATA')<=0){
       var a = t.split(/[\r\n]+/); //Split on Line Break
        for (var x = 0; x<a.length; x++){
            $('#result').append(a[x] + '<br>');
        } 
        $('#result').append('<hr>');
    }
});
Sign up to request clarification or add additional context in comments.

Comments

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.