Googlebot will index hidden <div class="display:none;">
content, but will also consider the CSS and ajax/flash when working out if this information should be included in the Google index - this is important because it means that Google will index Lazy loaded comment sections and other similar content.
Other hidden information like the <!-- comments -->
you ask about are ignored. I can't find official information to back this up, but it's easy to test by searching for commented information you know exists. So no, it wouldn't count as a backlink or confer other benefits.
The Bot's gotten very good at distinguishing between content hidden for SEO or discovery reasons and content hidden for acceptable reasons e.g. keyword or link stuffing. So it's best avoided lest you suffer a penalty.
In short, Google should see whatever a user sees, this discussion about hidden divs at google webmaster help should be informative regarding hidden content (Quoted Below).
Quoting user softplus:-
Hi Bill
Hidden text when misleading and off-topic can result in penalties and
bans. It is however almost impossible for Google to determine whether
or not text is misleading and hidden automatically. If your page's
user interface depends on hidden elements that is generally not a
problem (but it might result in your pages being indexed suboptimally
- eg when you have several text-elements on the same page all accessable through the same URL).
You can easily confirm that Google indexes hidden content like that by
placing unique text in one of those blocks, waiting for the page to be
re-indexed and then searching for it.
The reason Google reacts so strongly against misleading hidden text
and links is because they do index them correctly (and therefore they
do "work"). If Google were to just ignore hidden text, many sites
would try to use it. By giving a strong penalty (or even ban) the risk
involved with using hidden text to gain advantages is often larger
than the possible gain. (not to mention that you can usually just put
the same text in the visible sections of your pages anyway!)
If your hidden content is NOT sneaky, misleading, off-topic, etc then
you should have nothing to worry about. Many sites use hidden content
in one form or other as critical parts of the interface.
John
To answer your second question most <scripts>
include urls for three reasons:-
Self promotion - i.e. people chasing down plugins that they might want to use.
Licencing - i.e. indicating the circumstances the script can be used under and what rights the author retains to the code.
Updates/Documentation - i.e. allowing site owners to find the script source quickly so they can check for updates or instructions.
e.g.
/*
* FancyBox - jQuery Plugin
* Simple and fancy lightbox alternative
*
* Examples and documentation at: http://fancybox.net
*
* Copyright (c) 2008 - 2010 Janis Skarnelis
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
*
* Version: 1.3.4 (11/11/2010)
* Requires: jQuery v1.3+
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
<a>
link with anchor text, it's not a back link period.