Using JavaScript to Create Dynamic Content.

Posted by ActiveEnnovations

            The highlight of using JavaScript is that webpage content can be generated can be created dynamically, as opposed to being completely hard coded. One such example is that of the “write” function. The webpage in many cases will be referred to as the “document” object.

<html>

<body>

<script type="text/javascript">

document.write(<h2>The Title</h2>);

document.write(<p>The Content</p>);

</script>

</body>

</html>

            When the webpage loads, the html tags and their contents will be written into the page as if they were hardcoded into the page. Yes, the example is a bit goofy, but it is simplistic for this purpose. The uses of dynamic content can span into many fields of the website. Based upon a user’s answers or preferences a whole different block of text could be shown. This can be based on the user’s browser, age, gender, geographical location, and other such details.

 If the sex of the user is known, it could be used to change a reference to gender based words accordingly. Adding a “him” or “her” to the right positions adds an extra layer of personalization to a webpage. This gender personalization could also expand into the photos and advertising shown when they are viewing the webpage. The same customizations will follow for age and geographical location. The marketing purposes of this simple coding can go along way.

This practice has already been in use for a long time now. Did you ever notice the ads on Facebook that refer to the city you live in?  That is because they know where you live, or the general area anyways. And since you have an account there, they know specifics about you. It would be safe to assume that the ads guys see are not the same ads the young ladies see. They tailor the ads to what they believe your interests are.

Posted on: 7/9/2010 at 3:45 PM
Tags: , ,
Categories: JavaScript
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (9) | Post RSSRSS comment feed

Comments

Ugg Stripe Cable Knit People's Republic of China

Wednesday, October 20, 2010 11:25 AM

Ugg Stripe Cable Knit

This article gives the light in which we can observe the reality. This is very nice one and gives in-depth information

air jordan women People's Republic of China

Thursday, October 21, 2010 5:26 PM

air jordan women

This article gives the light in which we can observe the reality. This is very nice one and gives in-depth information

chestnut ugg classic short boots People's Republic of China

Friday, October 22, 2010 6:26 AM

chestnut ugg classic short boots

This article gives the light in which we can observe the reality. This is very nice one and gives in-depth information

timberland boots People's Republic of China

Friday, October 22, 2010 11:56 AM

timberland boots

These kind of post are always inspiring and I prefer to read quality content so I happy to find many good point here in the post, writing is simply great, thank you for the post!

wholesale uggs People's Republic of China

Friday, October 22, 2010 4:31 PM

wholesale uggs

This article gives the light in which we can observe the reality. This is very nice one and gives in-depth information

fototapety United States

Saturday, October 23, 2010 9:02 AM

fototapety

would it be possible to translate your website into spanish because i have difficulties of speaking to english, and as there are not many pictures on your website i would like to read more of what you are writting

geometry homework help United States

Tuesday, October 26, 2010 2:08 PM

geometry homework help

Have you considered adding some relevant links to the article? I think it might enhance viewers' understanding.

Cheap Laptop Insurance United Kingdom

Monday, November 22, 2010 8:17 PM

Cheap Laptop Insurance

I love the site layout ! How did you make it? It is very cool.

4G iPhone Insurance United States

Monday, November 22, 2010 8:21 PM

4G iPhone Insurance

I'm getting a browser error, is anyone else?

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading