I have the following function:
var id = \"10\"; var type = \"Type A\"; var img = \"myimage.jpg\"; jQuery.post(\"my/path/somefile.php\", { instance: \'getUrl
You should be able to do exactly what you have there - globals are visible inside functions unless there's already a local variable of the same name declared.