On 2 Dez., 20:56, Ryura <[EMAIL PROTECTED]> wrote:
> Thanks for the reply, Mike.
>
> I've tried that but I'm still thrown the error z is not defined
> $(function(){
> z=$("#getID").text();});
>
> document.write(z);
An additional thought: I think it isn't 100% obvious that you actually
want to create a global variable here. A co-worker might come along,
read the code and "fix" it.
That said in such a case I recommend to explicitly assign the variable
to the window object (which is technically the same):
$(function() {
window.z = ...
});
--Klaus