i have made a widget in my site so the users can take the code of the widget and insert it in their sites.the wiget is linked to my site.. does this link to my site in the javscript is considered by google and improve my rank???
Probably not - Google claim they are now able to spider links in java but only if the it's on the page (ie. not in an external java file). I don't know how your widget is coded, but try to get the link in plain html to be on the safe side.
what do you mean by external javascript and is it better if i add to the users the widget with <a herf.....></a>
You can check your site in lynx browser. If you can find your link there, then Google will also find that.
No, Javascript would not help you in anyway in improving your pagerank. You need to build quality links for your site if you want to increase your PR.