params for iframe modal

A newbe question: How do I pass parametes to the link I open in the iFrame? The values of the parameters would change in a runtime, so each opening of the modal should issue a call with different parameters' values. I understand somehow I'll have to modify href property of the Control.Modal instance, but how? I'd appreciate a code snippet.

Michael

Posted May 24th, 2007 at 12:22am by mkariv

More info: Currently I do it like below, and it works, but I feel there is a better way.

function customModal() { m = new Control.Modal($(id1),{ iframe: true, width: 640, height: 480 }); m.href=m.href+"?param1=val1¶m2=val2"; m.open();

} ...

test1

Posted May 24th, 2007 at 12:53am by mkariv

Sorry, i typed URL, w/o escapign it properly.

 <a id="id1" href="href1.html" onclick="customModal(); return false;">test1</a>

Posted May 24th, 2007 at 12:55am by mkariv

If the href's are going to change around a lot, your method works fine. There is probably a slightly more elegant way, but you're not missing anything huge. The library has two use cases in mind, overriding static anchor tags, and exposing the entire API to do what you want if that's not enough. Since the latter sounds true for you, you're down the right path.

Posted May 25th, 2007 at 9:38am by ryan

Login or Register to Post