jquery dialog with dynamic data

jquery dialog with dynamic data

Hello,

First I want to thank everyone who has helped me in previous posts (kbwood and jakecigar to name a few).  I'm not sure if my question is more php than jquery but it can't hurt to ask.

I"ve had success calling a jquery dialog with a hyperlink using href="#".  Where I"m running into problems, is linking to multiple dialogs on one page.  I'm hoping to call the dialog with an href="#{contentVariable}"
I"m using ExpressionEngine CMS, so once in the dialog I can call the correct data.  I"m just having problems with the link to the dialog.

I thought the code below may be the code to use but I'm stumped with what and were to add the code.  I inserted [I think I need code here] where I think I should add code.  Am I on the right track?  Or should I call a separate page?  

Thanks in advance if anyone can point me in the right direction.

Peter T

  1. $('a').click(function() {
  2.       var name = $(this).attr('href').[I think I need code here];
  3.       $('#dialog').dialog('open');
  4.       return false;
  5. });

the link to call the dialog
  1. <a href="/pt/emb/{contentVariable}" title="{title}" id="dialog"><img src="{pt_sample_thumb}" alt="{title}" width="170" height="170" border="0" /></a>

Once in the dialog

  1. <div id="content">
  2. {exp:channel:entries  channel="myinfo"  url_title="{contentVariable}" disable="member_data|categories"}
  3. <p><img src="{sample_file}" alt="{title}" width="640" height="480" border="0" /></p>
  4. {/exp:channel:entries}
  5. </div>