0

I would like to show a status in field but the result data is from an external link which means another sharepoint list. I'm using something similar below but not sure if this is the best way to do it.

   <td>
    <iframe src="/sites/showCommsStatus.aspx?id={@ID}&amp;user={$loginUser}" width="20px" height="25px"></iframe>
    </td>

As you can see i'm passing the ID and the login users name. How can i do this smarter maybe using jquery and a div? Thanks in Advance

1 Answer 1

1

Use jquery and a div, but specifically you can use the load method of jquery Watch out if this is cross site, you may need to change your approach. also Im not sure about your params here or how you are generatign them

This will do this on a docReady but you could try just putting the load outside of a docReady and see what happens.

<td><div id="thisOne"></div></td>

<script>
//$ can conflict you should really use noConflict in sharepoint especially 2010
//this does a docReady call, honest.
jQuery(function ($) { 

    $('#thisOne').load('/sites/showCommsStatus.aspx?id={@ID}&amp;user={$loginUser});


});
</script>

//http://api.jquery.com/load/
1
  • You probably also want to have "IsDlg=1" as a querystring parameter to get rid of SharePoint headers, etc. inside your iframe/dynamic div.
    – Jussi Palo
    Commented Jan 23, 2012 at 20:44

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.