javascript error (dynamic table generation)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yoshimishu
    New Member
    • Feb 2008
    • 29

    javascript error (dynamic table generation)

    HI,

    I am creating a page using javascript and dom. when i go to the new window and press abutton after selecting a option from a dropdown menu the table shoub appear within the same new page .

    Here is my piece of code I am not able to pass and print the value of selected option needed to generate a complete table.

    =============== =========
    [CODE=javascript]function y()
    {
    nwin=open("","" ,"");
    nwin.document.o pen();
    //nwin.document.w rite(xmlDoc.doc umentElement.ch ildNodes[0].childNodes[0].text);
    var it=xmlDoc.docum entElement.chil dNodes[0].getElementsByT agName("item");
    var le=it.length;
    nwin.document.w rite("<form id='f1'><select id='s1'>")
    for(var i = 0; i <le; i++)
    {
    n = it.item(i);
    nwin.document.w rite("<option value=\""+i+"\" >"+n.childNod es[0].text+"</option>");

    }
    nwin.document.w rite("</select><input type='button' value='get details' onclick='fun(); '></form>");

    function fun()
    {
    var r=document.f1.s 1.selectedIndex ;
    var outstring="<b>" + r +"</b>"
    document.inside .innerHTML=outs tring;
    }
    nwin.document.w rite("<div id='inside'></div>");
    nwin.document.c lose();
    }[/CODE]

    Thanks in advance
    Last edited by acoder; Feb 7 '08, 11:13 AM. Reason: Added code tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    First of all, welcome to TSDN!

    Re. your problem: how do you call the function and what's the error message and on which line?

    Comment

    • yoshimishu
      New Member
      • Feb 2008
      • 29

      #3
      Originally posted by acoder
      First of all, welcome to TSDN!

      Re. your problem: how do you call the function and what's the error message and on which line?
      Thanks for welcome.I check the browser type throuht if then and in evey if or then i call function y.I get object expected error, line 1 char1

      Here is the complete code:-

      =============== ==============
      code(javascipt)

      [HTML]<html>
      <head>
      <script language="javas cript">
      var xmlDoc;


      function showerror(error )
      {
      ewin=open("","" ,"");
      ewin.document.o pen();
      ewin.document.w rite("<b>XML parsing error</b><br><br>Error #: "+error.errorCo de+"<br>Descrip tion: "+error.reason+ "<br>In file: "+error.url+"<b r>Line:$
      ewin.document.c lose();
      }

      function y()
      {
      nwin=open("","" ,"");
      nwin.document.o pen();
      var it=xmlDoc.docum entElement.chil dNodes[0].getElementsByT agName("item");
      var le=it.length;
      nwin.document.w rite("<div id='inside'>sab </div>");
      function fun()
      {
      nwin.document.w rite("<form id='f1'><select id='s1'>");
      for(var i = 0; i <le; i++)
      {
      n = it.item(i);
      nwin.document.w rite("<option value=\""+i+"\" >"+n.childNod es[0].text+"</option>");

      }
      nwin.document.w rite("</select>");
      var r=document.f1.s 1.selectedIndex ;
      var ChosenTitle = document.f1.s1. options[r].text;
      var outtext+="<b>"+ ChosenTitle+"</b>"
      document.getEle mentById("insid e").innerHTML=o uttext;
      }

      nwin.document.w rite("<input type='button' value='get details' onClick='fun(); '></form>");
      nwin.document.c lose();
      }
      function x(file)
      {

      // code for IE
      if (window.ActiveX Object)
      {
      xmlDoc=new ActiveXObject(" Microsoft.XMLDO M");
      xmlDoc.async=fa lse;
      xmlDoc.load(fil e);
      if (xmlDoc.parseEr ror.errorCode != 0)
      {
      showerror(xmlDo c.parseError);
      }
      else
      {
      y();
      }

      }

      // code for Mozilla, Firefox, Opera, etc.
      else if (document.imple mentation && document.implem entation.create Document)
      {
      xmlDoc=document .implementation .createDocument ("","",null) ;
      //xmlDoc.load(fil e);
      xmlDoc.async=fa lse;
      if(!xmlDoc.load (file))
      {
      alert('Error in XML file');
      }
      else
      {
      y();
      }
      }

      else
      {
      alert('browser cannot handle this script');
      }
      xmlDoc.async=fa lse;
      }


      </script>
      </head>

      <body>
      <form name="form1">
      <b>Enter XML File </b><br>
      <input type="text" value="" id="t1" size="100" maxlength="100" ><br>
      <input type="button" value="button" name="button1" onClick="x(t1.v alue);">
      </form>
      </body>
      </html>[/HTML]
      Last edited by gits; Feb 7 '08, 11:48 AM. Reason: added code tags

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Why have you declared fun() inside y()?

        The error could be more useful if you checked the Firefox error console or Firebug.

        Show your XML code too.

        Comment

        • yoshimishu
          New Member
          • Feb 2008
          • 29

          #5
          here is the xml file:-


          ============

          [CODE=xml]<?xml version="1.0" encoding="UTF-8"?>
          <!-- generator="word press/2.0.5" -->
          <rss version="2.0"
          xmlns:content=" http://purl.org/rss/1.0/modules/content/"
          xmlns:wfw="http ://wellformedweb.o rg/CommentAPI/"
          xmlns:dc="http://purl.org/dc/elements/1.1/"
          >

          <channel>
          <title>Bits</title>
          <link>http://bits.blogs.nyti mes.com</link>
          <description> A New York Times blog</description>
          <pubDate>Mon, 28 Jan 2008 21:31:41 +0000</pubDate>

          <generator>http ://wordpress.org/?v=2.0.5</generator>
          <language>en</language>
          <item>
          <title>The Innovator’s Dilemma of a Toy Maker</title>
          <link>http://bits.blogs.nyti mes.com/2008/01/28/the-innovators-dilemma-of-a-toy-maker/</link>
          <comments>htt p://bits.blogs.nyti mes.com/2008/01/28/the-innovators-dilemma-of-a-toy-maker/#comments</comments>

          <pubDate>Mon, 28 Jan 2008 21:31:41 +0000</pubDate>
          <dc:creator>Mig uel Helft</dc:creator>

          <dc:subject>Inn ovations and Ideas</dc:subject><dc: subject>innovat ors dilemma</dc:subject><dc: subject>LeapFro g</dc:subject>
          <guid isPermaLink="fa lse">http://bits.blogs.nyti mes.com/2008/01/28/the-innovators-dilemma-of-a-toy-maker/</guid>
          <description> <![CDATA[LeapFrog's successor to the best-selling LeapPad, the Tag, is being introduced today. It could have been in toy stores years earlier. ]]></description>
          <wfw:commentRSS >http://bits.dblogs.nyt imes.com/?feed=rss2&amp; p=859</wfw:commentRSS>

          </item>
          <item>
          <title>Tracki ng Consumer Savings on eBay</title>
          <link>http://bits.blogs.nyti mes.com/2008/01/28/tracking-consumer-savings-on-ebay/</link>
          <comments>htt p://bits.blogs.nyti mes.com/2008/01/28/tracking-consumer-savings-on-ebay/#comments</comments>
          <pubDate>Mon, 28 Jan 2008 19:15:16 +0000</pubDate>
          <dc:creator>Bra d Stone</dc:creator>


          <dc:subject>Int ernet</dc:subject><dc: subject>EBay</dc:subject><dc: subject>Interne t auctions</dc:subject>
          <guid isPermaLink="fa lse">http://bits.blogs.nyti mes.com/2008/01/28/tracking-consumer-savings-on-ebay/</guid>
          <description> <![CDATA[A new study suggests consumers save billions of dollars by shopping on eBay auctions. ]]></description>
          <wfw:commentRSS >http://bits.dblogs.nyt imes.com/?feed=rss2&amp; p=858</wfw:commentRSS>
          </item>
          <item>

          <title>Hints That Europe Will Let Google Buy DoubleClick</title>
          <link>http://bits.blogs.nyti mes.com/2008/01/25/hints-that-europe-will-let-google-buy-doubleclick/</link>
          <comments>htt p://bits.blogs.nyti mes.com/2008/01/25/hints-that-europe-will-let-google-buy-doubleclick/#comments</comments>
          <pubDate>Fri, 25 Jan 2008 22:47:29 +0000</pubDate>
          <dc:creator>Sau l Hansell</dc:creator>

          <dc:subject>Int ernet</dc:subject>

          <dc:subject>Onl ine Marketing</dc:subject>
          <guid isPermaLink="fa lse">http://bits.blogs.nyti mes.com/2008/01/25/hints-that-europe-will-let-google-buy-doubleclick/</guid>
          <description> <![CDATA[Reading the tea leaves in Brussels provides clues that the European Commission is preparing to allow Google to buy DoubleClick after a year-long review. ]]></description>
          <wfw:commentRSS >http://bits.dblogs.nyt imes.com/?feed=rss2&amp; p=857</wfw:commentRSS>
          </item>
          <item>
          <title>Ruminati ng Over Identity at Sundance</title>

          <link>http://bits.blogs.nyti mes.com/2008/01/25/ruminating-over-identity-at-sundance/</link>
          <comments>htt p://bits.blogs.nyti mes.com/2008/01/25/ruminating-over-identity-at-sundance/#comments</comments>
          <pubDate>Fri, 25 Jan 2008 22:04:04 +0000</pubDate>
          <dc:creator>Kat ie Hafner</dc:creator>

          <dc:subject>Tec hnology and Society</dc:subject><dc: subject>Microso ft</dc:subject><dc: subject>MySpace </dc:subject><dc: subject>Reality Sandwich</dc:subject><dc: subject>Sundanc e</dc:subject>

          <guid isPermaLink="fa lse">http://bits.blogs.nyti mes.com/2008/01/25/ruminating-over-identity-at-sundance/</guid>
          <description> <![CDATA[The places young people find online to hang out are less fake than the lives they live with their parents, their teachers, even their real-life friends. It makes their lives more real, said panelists discussing technology and how it changes us. ]]></description>
          <wfw:commentRSS >http://bits.dblogs.nyt imes.com/?feed=rss2&amp; p=855</wfw:commentRSS>
          </item>
          <item>
          <title>Spectr um Auction: Bidders Spurn Frequencies Linked to Public Safety</title>
          <link>http://bits.blogs.nyti mes.com/2008/01/25/spectrum-auction-bidders-spurn-frequencies-linked-to-public-safety/</link>

          <comments>htt p://bits.blogs.nyti mes.com/2008/01/25/spectrum-auction-bidders-spurn-frequencies-linked-to-public-safety/#comments</comments>
          <pubDate>Fri, 25 Jan 2008 20:02:49 +0000</pubDate>
          <dc:creator>Sau l Hansell</dc:creator>[/code]

          [code=xml]<dc:subject>Tel ecommunications </dc:subject><dc: subject>fcc</dc:subject><dc: subject>spectru m</dc:subject>
          <guid isPermaLink="fa lse">http://bits.blogs.nyti mes.com/2008/01/25/spectrum-auction-bidders-spurn-frequencies-linked-to-public-safety/</guid>

          <description> <![CDATA[After four rounds of of the government auction, only a single bid has emerged for the block of frequencies meant to combine national wireless voice and data service with communications for public safety agencies. ]]></description>
          <wfw:commentRSS >http://bits.dblogs.nyt imes.com/?feed=rss2&amp; p=856</wfw:commentRSS>
          </item>
          <item>
          <title>Murdoc h Decides to Take WSJ.com’s Money Now</title>
          <link>http://bits.blogs.nyti mes.com/2008/01/25/murdoch-decides-to-take-wsjcoms-money-now/</link>
          <comments>htt p://bits.blogs.nyti mes.com/2008/01/25/murdoch-decides-to-take-wsjcoms-money-now/#comments</comments>

          <pubDate>Fri, 25 Jan 2008 15:08:23 +0000</pubDate>
          <dc:creator>Sau l Hansell</dc:creator>

          <dc:subject>Int ernet</dc:subject><dc: subject>Busines s Models</dc:subject><dc: subject>News Corporation</dc:subject><dc: subject>Wall Street Journal</dc:subject>
          <guid isPermaLink="fa lse">http://bits.blogs.nyti mes.com/2008/01/25/murdoch-decides-to-take-wsjcoms-money-now/</guid>
          <description> <![CDATA[By deciding to keep charging for the online edition of the Wall Street Journal, Rupert Murdoch is putting his interest in making more money ahead of his desire to use the Journal to advocate his conservative political views. ]]></description>

          <wfw:commentRSS >http://bits.dblogs.nyt imes.com/?feed=rss2&amp; p=854</wfw:commentRSS>
          </item>
          <item>
          <title>At Sundance, a Second Life Sweatshop Is Art</title>
          <link>http://bits.blogs.nyti mes.com/2008/01/25/at-sundance-a-second-life-sweatshop-is-art/</link>
          <comments>htt p://bits.blogs.nyti mes.com/2008/01/25/at-sundance-a-second-life-sweatshop-is-art/#comments</comments>

          <pubDate>Fri, 25 Jan 2008 13:58:34 +0000</pubDate>
          <dc:creator>Kat ie Hafner</dc:creator>

          <dc:subject>Int ernet</dc:subject>
          <dc:subject>Inn ovations and Ideas</dc:subject><dc: subject>Invisib le Threads</dc:subject><dc: subject>second life</dc:subject><dc: subject>Sundanc e</dc:subject>
          <guid isPermaLink="fa lse">http://bits.blogs.nyti mes.com/2008/01/25/at-sundance-a-second-life-sweatshop-is-art/</guid>

          <description> <![CDATA[Want a window into so-called telemetric manufacturing methods of the future? Performance artists at the Sundance Film Festival created a virtual sweatshop in Second Life that makes real jeans. Is it art for money or money for art? ]]></description>
          <wfw:commentRSS >http://bits.dblogs.nyt imes.com/?feed=rss2&amp; p=853</wfw:commentRSS>
          </item>
          <item>
          <title>The Art of Nanotech</title>
          <link>http://bits.blogs.nyti mes.com/2008/01/25/the-art-of-nanotech/</link>
          <comments>htt p://bits.blogs.nyti mes.com/2008/01/25/the-art-of-nanotech/#comments</comments>[/code]

          [code=xml] <pubDate>Fri, 25 Jan 2008 13:55:15 +0000</pubDate>
          <dc:creator>Bar naby J. Feder</dc:creator>

          <dc:subject>Nan otechnology</dc:subject><dc: subject>art</dc:subject><dc: subject>Cris Orfescu</dc:subject><dc: subject>nanotec hnology</dc:subject>
          <guid isPermaLink="fa lse">http://bits.blogs.nyti mes.com/2008/01/25/the-art-of-nanotech/</guid>
          <description> <![CDATA[Nanotechnology is a new medium for art. ]]></description>

          <wfw:commentRSS >http://bits.dblogs.nyt imes.com/?feed=rss2&amp; p=851</wfw:commentRSS>
          </item>
          <item>
          <title>Spectr um Auction Day 1: $2.779 Billion in Bids</title>
          <link>http://bits.blogs.nyti mes.com/2008/01/24/spectrum-auction-day-1-2779-billion-in-bids/</link>
          <comments>htt p://bits.blogs.nyti mes.com/2008/01/24/spectrum-auction-day-1-2779-billion-in-bids/#comments</comments>

          <pubDate>Thu, 24 Jan 2008 23:49:21 +0000</pubDate>
          <dc:creator>Sau l Hansell</dc:creator>

          <dc:subject>Tel ecommunications </dc:subject><dc: subject>fcc</dc:subject><dc: subject>spectru m</dc:subject>
          <guid isPermaLink="fa lse">http://bits.blogs.nyti mes.com/2008/01/24/spectrum-auction-day-1-2779-billion-in-bids/</guid>
          <description> <![CDATA[Bidding has started for the wireless spectrum that is being abandoned by the move to digital television. So far, it's not clear whether there will be enough interest for the government to receive the $10 billion it wants. ]]></description>
          <wfw:commentRSS >http://bits.dblogs.nyt imes.com/?feed=rss2&amp; p=852</wfw:commentRSS>

          </item>
          <item>
          <title>John Donahoe’s Plan to Save eBay: Better Search</title>
          <link>http://bits.blogs.nyti mes.com/2008/01/24/john-donahoes-plan-to-save-ebay-better-search/</link>
          <comments>htt p://bits.blogs.nyti mes.com/2008/01/24/john-donahoes-plan-to-save-ebay-better-search/#comments</comments>
          <pubDate>Thu, 24 Jan 2008 19:34:14 +0000</pubDate>
          <dc:creator>Sau l Hansell</dc:creator>


          <dc:subject>Int ernet</dc:subject><dc: subject>EBay</dc:subject><dc: subject>John Donahoe</dc:subject>
          <guid isPermaLink="fa lse">http://bits.blogs.nyti mes.com/2008/01/24/john-donahoes-plan-to-save-ebay-better-search/</guid>
          <description> <![CDATA[The incoming chief executive of eBay, John Donahoe, says he is planning a new search engine to show users the best offers from the best sellers with low prices, fast shipping and high quality. He's also prepared for a wave of protest from sellers whose listings are not featured in the new search results. ]]></description>
          <wfw:commentRSS >http://bits.dblogs.nyt imes.com/?feed=rss2&amp; p=850</wfw:commentRSS>
          </item>[/code]
          [code=xml] <item>

          <title>YouTub e On the Go</title>
          <link>http://bits.blogs.nyti mes.com/2008/01/24/youtube-on-the-go/</link>
          <comments>htt p://bits.blogs.nyti mes.com/2008/01/24/youtube-on-the-go/#comments</comments>
          <pubDate>Thu, 24 Jan 2008 14:23:56 +0000</pubDate>
          <dc:creator>Mig uel Helft</dc:creator>

          <dc:subject>Int ernet</dc:subject>

          <dc:subject>Mus ic and Video</dc:subject><dc: subject>Google</dc:subject><dc: subject>Mobile phones</dc:subject><dc: subject>video</dc:subject><dc: subject>YouTube </dc:subject>
          <guid isPermaLink="fa lse">http://bits.blogs.nyti mes.com/2008/01/24/youtube-on-the-go/</guid>
          <description> <![CDATA[YouTube expands its mobile site to make the experience of watching videos on the go more like it is on the PC. ]]></description>
          <wfw:commentRSS >http://bits.dblogs.nyt imes.com/?feed=rss2&amp; p=849</wfw:commentRSS>
          </item>

          <item>
          <title>Last.F M Has a First With Streaming Music</title>
          <link>http://bits.blogs.nyti mes.com/2008/01/23/lastfm-is-first-with-streaming-music-users-choose/</link>
          <comments>htt p://bits.blogs.nyti mes.com/2008/01/23/lastfm-is-first-with-streaming-music-users-choose/#comments</comments>
          <pubDate>Wed, 23 Jan 2008 15:45:16 +0000</pubDate>
          <dc:creator>Sau l Hansell</dc:creator>


          <dc:subject>Mus ic and Video</dc:subject><dc: subject>Busines s Models</dc:subject><dc: subject>cbs</dc:subject><dc: subject>imeem</dc:subject><dc: subject>last.fm </dc:subject><dc: subject>Music</dc:subject>
          <guid isPermaLink="fa lse">http://bits.blogs.nyti mes.com/2008/01/23/lastfm-is-first-with-streaming-music-users-choose/</guid>
          <description> <![CDATA[Last.FM, the free online radio service owned by CBS, will let users listen to any of 3.5 million songs on demand, paid for with advertising. The key limit: each user can only listen to each song 3 times. ]]></description>
          <wfw:commentRSS >http://bits.dblogs.nyt imes.com/?feed=rss2&amp; p=848</wfw:commentRSS>

          </item>[/code]
          [code=xml] <item>
          <title>Tracki ng the World’s Appetite for Innovation</title>
          <link>http://bits.blogs.nyti mes.com/2008/01/23/tracking-the-worlds-appetite-for-innovation/</link>
          <comments>htt p://bits.blogs.nyti mes.com/2008/01/23/tracking-the-worlds-appetite-for-innovation/#comments</comments>
          <pubDate>Wed, 23 Jan 2008 15:40:09 +0000</pubDate>

          <dc:creator>Ste ve Lohr</dc:creator>

          <dc:subject>Tec hnology and Society</dc:subject><dc: subject>H P</dc:subject><dc: subject>innovat ion</dc:subject><dc: subject>knowled ge economy</dc:subject><dc: subject>Microso ft</dc:subject><dc: subject>Product ivity</dc:subject><dc: subject>Unisys</dc:subject>
          <guid isPermaLink="fa lse">http://bits.blogs.nyti mes.com/2008/01/23/tracking-the-worlds-appetite-for-innovation/</guid>
          <description> <![CDATA[ In its quest for what it calls “new metrics for the knowledge economy,” a nonprofit research group has come up with an index of global innovation confidence.
          The poll of 25,000 people in a dozen nations, published on Tuesday, found the United States squarely in the middle [...] ]]></description>

          <wfw:commentRSS >http://bits.dblogs.nyt imes.com/?feed=rss2&amp; p=846</wfw:commentRSS>
          </item>
          <item>
          <title>Can the Touch Revive Apple’s iPod Sales?</title>
          <link>http://bits.blogs.nyti mes.com/2008/01/22/can-the-touch-revive-apples-ipod-sales/</link>
          <comments>htt p://bits.blogs.nyti mes.com/2008/01/22/can-the-touch-revive-apples-ipod-sales/#comments</comments>

          <pubDate>Tue, 22 Jan 2008 23:51:11 +0000</pubDate>
          <dc:creator>Sau l Hansell</dc:creator>

          <dc:subject>Con sumer Electronics</dc:subject>
          <dc:subject>Har dware</dc:subject><dc: subject>Apple</dc:subject><dc: subject>ipod</dc:subject>
          <guid isPermaLink="fa lse">http://bits.blogs.nyti mes.com/2008/01/22/can-the-touch-revive-apples-ipod-sales/</guid>

          <description> <![CDATA[Despite a 10 percent drop in Apple's shares, the company did very well in the fourth quarter, putting $3 billion in the bank. It plans to address its main weakness--slow growth in iPod sales--by emphasizing the Internet capability of the iPod Touch. ]]></description>
          <wfw:commentRSS >http://bits.dblogs.nyt imes.com/?feed=rss2&amp; p=847</wfw:commentRSS>
          </item>
          <item>
          <title>Europe : Your I.P. Address Is Personal</title>
          <link>http://bits.blogs.nyti mes.com/2008/01/22/europe-your-ip-address-is-personal/</link>
          <comments>htt p://bits.blogs.nyti mes.com/2008/01/22/europe-your-ip-address-is-personal/#comments</comments>

          <pubDate>Tue, 22 Jan 2008 20:31:20 +0000</pubDate>
          <dc:creator>Sau l Hansell</dc:creator>

          <dc:subject>Pol icy and Law</dc:subject><dc: subject>Google</dc:subject><dc: subject>Privacy </dc:subject>
          <guid isPermaLink="fa lse">http://bits.blogs.nyti mes.com/2008/01/22/europe-your-ip-address-is-personal/</guid>
          <description> <![CDATA[At a hearing Monday, a top European regulator said that Internet Protocol addresses, which identify computers connected to the Internet, should be treated as personal information, something Google and other sites have resisted. ]]></description>
          <wfw:commentRSS >http://bits.dblogs.nyt imes.com/?feed=rss2&amp; p=845</wfw:commentRSS>

          </item>
          <item>
          <title>Report Says Whitman to Leave After Conservative Decade at eBay</title>
          <link>http://bits.blogs.nyti mes.com/2008/01/22/report-says-whitman-to-leave-after-conservative-decade-at-ebay/</link>
          <comments>htt p://bits.blogs.nyti mes.com/2008/01/22/report-says-whitman-to-leave-after-conservative-decade-at-ebay/#comments</comments>
          <pubDate>Tue, 22 Jan 2008 16:33:53 +0000</pubDate>
          <dc:creator>Sau l Hansell</dc:creator>


          <dc:subject>Int ernet</dc:subject><dc: subject>EBay</dc:subject><dc: subject>Meg Whitman</dc:subject>
          <guid isPermaLink="fa lse">http://bits.blogs.nyti mes.com/2008/01/22/report-says-whitman-to-leave-after-conservative-decade-at-ebay/</guid>
          <description> <![CDATA[Meg Whitman is about to announce her retirement after a decade running eBay, a report says. The company faces challenges from Google and Amazon, and it may need to make more radical changes than has been the style of the cautious Ms. Whitman. ]]></description>
          <wfw:commentRSS >http://bits.dblogs.nyt imes.com/?feed=rss2&amp; p=844</wfw:commentRSS>
          </item>[/code]
          [code=xml] <item>

          <title>Bits Debate: On the Rights of Readers and Viewers</title>
          <link>http://bits.blogs.nyti mes.com/2008/01/18/bits-debate-on-the-rights-of-readers-and-viewers/</link>
          <comments>htt p://bits.blogs.nyti mes.com/2008/01/18/bits-debate-on-the-rights-of-readers-and-viewers/#comments</comments>
          <pubDate>Sat, 19 Jan 2008 03:19:32 +0000</pubDate>
          <dc:creator>Sau l Hansell</dc:creator>

          <dc:subject>Pol icy and Law</dc:subject><dc: subject>bits debate: copyright</dc:subject><dc: subject>Copyrig ht</dc:subject><dc: subject>fair use</dc:subject>

          <guid isPermaLink="fa lse">http://bits.blogs.nyti mes.com/2008/01/18/bits-debate-on-the-rights-of-readers-and-viewers/</guid>
          <description> <![CDATA[Is the march of technology taking away rights people used to enjoy, such as the ability to make personal copies of things they buy? Tim Wu, of Columbia Law School, says technology is eroding the value of ownership. Rick Cotton, of NBC Universal, says new copy protection systems will give more options to consumers. The Bits Debate continues. ]]></description>
          <wfw:commentRSS >http://bits.dblogs.nyt imes.com/?feed=rss2&amp; p=843</wfw:commentRSS>
          </item>
          <item>
          <title>You’re Not Buying Gadgets, You Are Subscribing to Them</title>

          <link>http://bits.blogs.nyti mes.com/2008/01/18/youre-not-buying-gadgets-any-more-you-are-subscribing-to-them/</link>
          <comments>htt p://bits.blogs.nyti mes.com/2008/01/18/youre-not-buying-gadgets-any-more-you-are-subscribing-to-them/#comments</comments>
          <pubDate>Sat, 19 Jan 2008 00:15:04 +0000</pubDate>
          <dc:creator>Sau l Hansell</dc:creator>

          <dc:subject>Con sumer Electronics</dc:subject><dc: subject>Blu ray</dc:subject><dc: subject>digital television</dc:subject><dc: subject>Televis ions</dc:subject>

          <guid isPermaLink="fa lse">http://bits.blogs.nyti mes.com/2008/01/18/youre-not-buying-gadgets-any-more-you-are-subscribing-to-them/</guid>
          <description> <![CDATA[A new specification will add features to Blu-ray disc players proves that people really just subscribe to consumer electronics rather than buying them. Accept that and you can defend profligate spending on the latest TV or being a penny-pincher. ]]></description>
          <wfw:commentRSS >http://bits.dblogs.nyt imes.com/?feed=rss2&amp; p=842</wfw:commentRSS>
          </item>
          <item>
          <title>Slide Slides Into Some Cash</title>
          <link>http://bits.blogs.nyti mes.com/2008/01/18/slide-slides-into-some-cash/</link>

          <comments>htt p://bits.blogs.nyti mes.com/2008/01/18/slide-slides-into-some-cash/#comments</comments>
          <pubDate>Fri, 18 Jan 2008 19:25:46 +0000</pubDate>
          <dc:creator>Bra d Stone</dc:creator>

          <dc:subject>Int ernet</dc:subject>
          <dc:subject>Sil icon Valley</dc:subject>
          <dc:subject>Ven ture Capital and Finance</dc:subject>

          <guid isPermaLink="fa lse">http://bits.blogs.nyti mes.com/2008/01/18/slide-slides-into-some-cash/</guid>
          <description> <![CDATA[Slide, the maker of applications for social networks, has raised another round of financing – $50 million from the private equity funds at Fidelity and T-Rowe Price. ]]></description>
          <wfw:commentRSS >http://bits.dblogs.nyt imes.com/?feed=rss2&amp; p=841</wfw:commentRSS>
          </item>
          <item>
          <title>A Less Stylish Approach to RFID</title>
          <link>http://bits.blogs.nyti mes.com/2008/01/18/a-less-stylish-approach-to-rfid/</link>

          <comments>htt p://bits.blogs.nyti mes.com/2008/01/18/a-less-stylish-approach-to-rfid/#comments</comments>
          <pubDate>Fri, 18 Jan 2008 16:10:01 +0000</pubDate>
          <dc:creator>Bar naby J. Feder</dc:creator>

          <dc:subject>Nan otechnology</dc:subject><dc: subject>I.B.M.</dc:subject><dc: subject>Metro Group</dc:subject><dc: subject>RFID</dc:subject>
          <guid isPermaLink="fa lse">http://bits.blogs.nyti mes.com/2008/01/18/a-less-stylish-approach-to-rfid/</guid>

          <description> <![CDATA[Metro Group, the giant German grocery and consumer goods retailer, has been a leader in applying RFID tags to shipments of goods to track their progress through its distribution chain. It is starting a new effort to test if customers will accept tags on clothes. ]]></description>
          <wfw:commentRSS >http://bits.dblogs.nyt imes.com/?feed=rss2&amp; p=838</wfw:commentRSS>
          </item>
          </channel>
          </rss>[/CODE]
          Last edited by acoder; Feb 7 '08, 12:40 PM. Reason: Added code tags + removed quote

          Comment

          • yoshimishu
            New Member
            • Feb 2008
            • 29

            #6
            hi,

            here is an simple sort of main crux of my main progam if this works then I guess main program wil work .kindly check error in this:-

            ==========
            code(javascript )
            UW PICO(tm) 4.0 File: koh.html Modified

            [HTML]<HTML>
            <head>
            <SCRIPT language="javas cript">

            function insertScript()
            {
            var c=document.getE lementById("f1" ).s1.options[f1.s1.selectedI ndex].text;
            var sHTML="<table border='1'>"
            sHTML=sHTML+"<t r><td>"+c+"</tr></td>"
            sHTML=sHTML+"<t r><td>"+c+"</tr></td>"
            sHTML=sHTML+"</table>"
            document.getEle mentById("Scrip tDiv").innerHTM L =sHTML;
            }


            function k()
            {
            nwin=open("","" ,"");
            nwin.document.o pen();
            nwin.document.w rite("<DIV ID='ScriptDiv'> </DIV>");
            nwin.document.w rite("<form id='f1'>");
            nwin.document.w rite("<select id='s1'>");
            nwin.document.w rite("<option value=1>one</option>");
            nwin.document.w rite("<option value=2>two</option>");
            nwin.document.w rite("</select>");
            nwin.document.w rite("<input type='button' value='button' onclick='insert Script();'>");
            nwin.document.w rite("</form>");
            nwin.document.c lose();
            }
            </script>
            </head>
            <body>
            <form>
            <input type="button" value="button" onclick="k();">
            </form>
            </body>
            </HTML>[/HTML]
            Last edited by acoder; Feb 7 '08, 01:16 PM. Reason: removed quote to avoid bug

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #7
              k() opens a new window and the button within the code calls insertScript(), but insertScript is in the parent page. Either write insertScript in the popup page or call window.opener.i nsertScript() instead.

              Comment

              • yoshimishu
                New Member
                • Feb 2008
                • 29

                #8
                Originally posted by acoder
                k() opens a new window and the button within the code calls insertScript(), but insertScript is in the parent page. Either write insertScript in the popup page or call window.opener.i nsertScript() instead.
                if I use window.opener.i nsertscript new error comes in the line

                document.getEle mentById("f1") has no properties
                [Break on this error] var c=this.document .getElementById ("f1").s1.optio ns[f1.s1.selectedI ndex]...

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  #9
                  If you're going to use s1, then you have to name your select element "s1". Alternatively, just access the select element directly, e.g. [code=javascript]var c = document.getEle mentById("s1"). options[document.getEle mentById("s1"). selectedIndex];[/code]

                  Comment

                  • yoshimishu
                    New Member
                    • Feb 2008
                    • 29

                    #10
                    Originally posted by acoder
                    If you're going to use s1, then you have to name your select element "s1". Alternatively, just access the select element directly, e.g. [code=javascript]var c = document.getEle mentById("s1"). options[document.getEle mentById("s1"). selectedIndex];[/code]

                    This code is still not working it has some problem with var c it says var c=document.form 1.select1.optio ns[document.form1. select1.selecte dIndex].value;

                    has no properites.I think it cannot acess the selectedindex value from document. I am really confused with the function insertscript is in parent or child window.

                    Comment

                    • acoder
                      Recognized Expert MVP
                      • Nov 2006
                      • 16032

                      #11
                      Originally posted by yoshimishu
                      This code is still not working it has some problem with var c it says var c=document.form 1.select1.optio ns[document.form1. select1.selecte dIndex].value;

                      has no properites.
                      Is your form named "form1" and your select element "select1"?

                      Comment

                      • yoshimishu
                        New Member
                        • Feb 2008
                        • 29

                        #12
                        Originally posted by acoder
                        Is your form named "form1" and your select element "select1"?
                        yes, I am trying for this for a bunch of hours but not getting it

                        Comment

                        • acoder
                          Recognized Expert MVP
                          • Nov 2006
                          • 16032

                          #13
                          Originally posted by yoshimishu
                          yes, I am trying for this for a bunch of hours but not getting it
                          Can I see your new simple version of the code now?

                          Comment

                          • yoshimishu
                            New Member
                            • Feb 2008
                            • 29

                            #14
                            Originally posted by acoder
                            Can I see your new simple version of the code now?
                            this is simple code it is not displaying when we choose the option from the dropdown and then ckick the button:--

                            =============== ==========
                            code(javascript )
                            [HTML]<html>
                            <head>
                            <script type="text/javascript">


                            function sr()
                            {
                            var s="<b>sab</b>"
                            return s
                            }

                            function k()
                            {
                            var nwin=open("","n ame","");
                            nwin.document.o pen();

                            nwin.document.w rite("<form id='f1' name='form1'>") ;
                            nwin.document.w rite("<select id='s1' name='select1'> ");
                            nwin.document.w rite("<option value=1>one</option>");
                            nwin.document.w rite("<option value=2>two</option>");
                            nwin.document.w rite("</select>");
                            nwin.document.w rite("<input type='button' value='get details' onclick=documen t.getElementByI d('ScriptDiv'). innerHTML = sab; >");
                            nwin.document.w rite("</form>");
                            nwin.document.w rite("<div id='ScriptDiv'> ab</div>");
                            nwin.document.c lose();
                            }
                            </script>
                            </head>
                            <body>
                            <form>
                            <input type="button" value="button" onclick="k();">
                            </form>
                            </body>
                            </html>[/HTML]
                            Last edited by acoder; Feb 8 '08, 10:55 AM. Reason: Added code tags

                            Comment

                            • yoshimishu
                              New Member
                              • Feb 2008
                              • 29

                              #15
                              Originally posted by yoshimishu
                              this is simple code it is not displaying when we choose the option from the dropdown and then ckick the button:--

                              =============== ==========
                              code(javascript )
                              [HTML]<html>
                              <head>
                              <script type="text/javascript">


                              function sr()
                              {
                              var s="<b>sab</b>"
                              return s
                              }

                              function k()
                              {
                              var nwin=open("","n ame","");
                              nwin.document.o pen();

                              nwin.document.w rite("<form id='f1' name='form1'>") ;
                              nwin.document.w rite("<select id='s1' name='select1'> ");
                              nwin.document.w rite("<option value=1>one</option>");
                              nwin.document.w rite("<option value=2>two</option>");
                              nwin.document.w rite("</select>");
                              nwin.document.w rite("<input type='button' value='get details' onclick=documen t.getElementByI d('ScriptDiv'). innerHTML = sr(); >");
                              nwin.document.w rite("</form>");
                              nwin.document.w rite("<div id='ScriptDiv'> ab</div>");
                              nwin.document.c lose();
                              }
                              </script>
                              </head>
                              <body>
                              <form>
                              <input type="button" value="button" onclick="k();">
                              </form>
                              </body>
                              </html>[/HTML]
                              I have edited the code document.getEle mentById('Scrip tDiv').innerHTM L= sr();

                              Comment

                              Working...