SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Non-Member
    Join Date
    Sep 2008
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ebay template using javascript

    i saw a few ebay templates using document.write(unescape .... Something to call java script. anyone have any idea how to use it? what i want in my template is to use tab view and mouserollover function only and that works using javascript
    thanks in advance

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2007
    Location
    USA
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb

    My apologies if this is not what you are asking about, but what you are describing is a method of using Javascript to write HTML output. For example, on one of my web properties I have an external Javascript file that I can call somewhere in the HTML file to display my content, perhaps in the sidebar of the page.
    Code:
     < script language="javascript" type="text/javascript" src="js/sidebar_quotes.js"> < /script>
    So in the web page I type the following to call the Javascript. Then the HTML output of the Javascript will be displayed in that area. Below are the contents of this example Javascript file.
    PHP Code:
     /* sidebar_quotes.js */ /* for random quotes displayed in the sidebar */ /* inspiration from http://www.computerhope.com/j15.htm */ /* store the quotations in arrays */  quotes = new Array(3); authors = new Array(3);  quotes[0] = "First test quote."authors[0] = "First author name";  quotes[1] = "Second text quote"authors[1] = "Second author name";  quotes[2] = "Third text quote"authors[2] = "Third author name";  quotes[3] = "Fourth text quote"authors[3] = "Fourth author name";   /* calculate a random index */ index Math.floor(Math.random() * quotes.length);  /* display the quotation */ document write("< h1>Wise Words< /h1>\n"); document write("< div class=\"left-box\">\n"); document write("< p>" "\"" quotes[index] + "\"< /p>\n"); document write("< p class=\"align-right\">" "-- " authors[index] + "< /p>\n"); document write("< /div>\n");  /* end of file */ 
    My usage of Javascript was just an example. Does this help to answer your question? In your Javascript file you can enter whatever you want to display for HTML output. One reason someone would do this would be because they want to repeatedly display the same content on different pages. So they just make a call to this single Javascript. Later if changes need to be made, then you just edit a single file and the updates are displayed immediately. Examples include footers, sidebars, or shipping policies for auctions, etc.

  3. #3
    SitePoint Member
    Join Date
    Nov 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i think this site can be helpful to you roseindia dot net/software-tutorials


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •