I can’t seem to find the answer to this question anywhere so I ask here.
I already use successfully fancybox like this:
$("#editor").fancybox({
'width' : 1000,
'height' : 600,
'autoDimensions' : false,
'autoScale' : false,
'ajax' : {
type : "POST",
data : varstring
}
})
Now the problem is that due to new necessities the varstring must contain unique data for each of the link that should open the fancybox window.
Tha way I was picturing it is like this:
function openEditor(elementid,sid,pid,gid){
$("#"+elementid).fancybox({
'width' : 1000,
'height' : 600,
'autoDimensions' : false,
'autoScale' : false,
'ajax' : {
type : "POST",
data : 'varstringnotimplemented'
}
});
//$("#"+elementid).trigger('click');
return false;
}
It doesn’t work, if I uncomment the trigger I get a:
uncaught exception: Syntax error, unrecognized expression: #
Even if I manage to get this thing working is pretty ugly, is there a better way to do this?
Thank you
It would be better to pass the actual object instead of an id.
link would be
you cannot pass the actual object if you send it trough the href, you can send it through the onclick