Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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/
share|improve this answer
    
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 Jan 23 '12 at 20:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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