List Info

Thread: Re: first array for link building




Re: first array for link building
country flaguser name
India
2007-10-18 07:18:11

we would do it this way br>
<script language="JavaScript" type=";text/javascript";>

function func() {

var HorizontalLinks=[['Yahoo','www.yahoo.com' ,'Yahoo'],['AOL','www.aol.com','AOL'],['T. J. jay','www.geocities.com','My Site']];

var stri ;

for (var i=0; i<HorizontalLinks.length; i++)

{

document.getElementById('iner').innerHTML += "http://"; + HorizontalLinks[i][1] + "&quot;>"; + HorizontalLinks[i][0] + "

";

stri = "&quot; ;

}

}

</script>

&lt;body onload=&quot;func()&quot;>

<div id="iner"&gt;

<;/div>

</body>

we would make a function out of it and call it when the page loads. However note the ' += ' string concatenate operator. this is because everytime we use the innerHTML function, it writes the whole of the contents of the 'div' with id 'iner'. The old content of 'iner' is replaced, not added to.

trshant

----- Original Message ----

From: Aaron L. < elmastero74%40gmail.com">elmastero74gmail.com>

To: 1stJavaScript%40yahoogroups.com">1stJavaScriptyahoogroups.com

Sent: Wednesday, 17 October, 2007 7:53:16 PM

Subject: Re: [1stJavaScript] first array for link building

Nice work, Alligator.

Just out of curiosity, how could one do this using innerHTML instead of

document.write?

-a

On 10/16/07, Alligator < alligator_666%40yahoo.com">alligator_666yahoo.com> wrote:

>

> You are closing document.write in the wrong place:

> document.write('http://' + HorizontalLinks[i][1]) ......

>

> This should work:

> <script type='text/javascript'>

> <!--

>

> function printLinks() {

>; var HorizontalLinks = [ ["Yahoo" , "www.yahoo.com&quot;; , "Yahoo"],

> ["Mental Health&quot;, "www.MH.Alabama.GOV";, "ADMH"],

> ["T. J. jay", "www.MH.Alabama.GOV";, "My Site"] ];

&gt;

>; for (var i = 0; i < HorizontalLinks.length; i++) {

>; document.write('' +

>; HorizontalLinks[i][0] + '</a>;<br/>;');

> }

>; }

>;

> // -->

> </script>

>

&gt; Alligator_666

&gt; http://www.vicxsite.com/

>

&gt; Smokey < tjjay%40yahoo.com">tjjayyahoo.com <tjjay%40yahoo.com>> wrote: Greetings, all,

>

&gt; my first attempt at array building and then writing as links

>

> -------------source follows----------

>

> <script type=";text/javascript";>

>

&gt; var HorizontalLinks=new Array()

>

> /* <a title=&quot;screen tip" href=";#1"&gt;displayed title</a> */

&gt;

>; HorizontalLinks[0]=["Yahoo", "www.yahoo.com&quot;;, "Yahoo"]

> HorizontalLinks[1]=["Mental Health&quot;, "www.MH.Alabama.GOV";, "ADMH"]

> HorizontalLinks[2]=["T. J. jay", "www.MH.Alabama.GOV";, "My Site"]

>

> for (i=0; i<HorizontalLinks.length; i++)

>

> {

>;

> document.write(''+

> HorizontalLinks[i][0] + '</a>;')

&gt;

>; }

>;

> </script>

>

&gt; ----------source ends----------

>

&gt; i get absolutely nothing in either MSIE or netscape. javaconsole for

&gt; netscape isn't much help either.

>

> anyone want to help a newbie? thanks

>

>

>

&gt;

&gt;

>; ---------------------------------

&gt; Be a better Heartthrob. Get better relationship answers from someone who

&gt; knows.

> Yahoo! Answers - Check it out.

>

&gt; [Non-text portions of this message have been removed]

>

>

>

[Non-text portions of this message have been removed]

For a quick response, your message should include,

- A copy of the code

- A copy of any error messages

- A description of what you're trying to achieve

- A description of what's actually happening

http://www.trans4mind.com/personal_development/HTMLGuide/index.html For HTML

http://www.trans4mind.com/personal_development/JavaScript/index.html For JavaScript

You can also download the JavaScript and HTML tutorials (Nearly 2.5 megabytes.)

A 30 day version of jsEditor is available for free download at

http://www.trans4mind.com/personal_development/JavaScript/freeEditor.htm

--------------------------

FREE zip/unzip program:

http://www.trans4mind.com/personal_development/zipper/index.html

--------------------------OR go to and change your settings:

http://groups.yahoo.com/group/1stJavaScript/

List owner: 1stJavaScript-owner%40yahoogroups.com">1stJavaScript-owneryahoogroups.com

://groups.yahoo.com/group/1stJavaScript/

List owner: 1stJavaScript-owner%40yahoogroups.com">1stJavaScript-owneryahoogroups.com

Yahoo! Groups Links

http://groups.yahoo.com/group/1stJavaScript/

Individual Email | Traditional

http://groups.yahoo.com/group/1stJavaScript/join

(Yahoo! ID required)

mailto: 1stJavaScript-digest%40yahoogroups.com">1stJavaScript-digestyahoogroups.com

mailto: 1stJavaScript-fullfeatured%40yahoogroups.com">1stJavaScript-fullfeaturedyahoogroups.com

1stJavaScript-unsubscribe%40yahoogroups.com">1stJavaScript-unsubscribeyahoogroups.com

http://docs.yahoo.com/info/terms/

Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )