Jump to content

madsovenielsen

Members
  • Content Count

    142
  • Joined

  • Last visited

Community Reputation

1 Neutral

About madsovenielsen

  • Rank
    Member
  • Birthday 05/15/1987

Previous Fields

  • Languages
    XHTML, CSS, JavaScript, XML, ASP, PHP,

Contact Methods

  • Website URL
    http://
  • ICQ
    0

Profile Information

  • Location
    Denmark
  1. HelloI know this is a total newb question, but i have the following SQL: SELECT FagNavn, adgangskrav, Ugedag, holdId, fagKode, CONVERT(CHAR(10), StartDato, 105) AS startDate, CONVERT(CHAR(10), slutDato, 105) AS endDate, afdeling, link, navn, deltagerBetaling, bt, niveau, Case When Ugedag = 'Mandag' Then frakl + ' - ' + tilkl Else '' End AS startSlutMandag, Case When Ugedag = 'Tirsdag' Thenfrakl + ' - ' + tilkl Else '' End AS startSlutTirsdag, Case When Ugedag = 'Onsdag' Thenfrakl + ' - ' + tilkl Else '' End AS startSlutOnsdag, Case When Ugedag = 'Torsdag' Then frakl + ' - ' + tilkl Else '' End AS startSlutTorsdag, Case When Ugedag = 'Fredag' Thenfrakl + ' - ' + tilkl Else '' End AS startSlutFredag FROM [VisWebHoldSkema] ORDER BY afdeling This is giving me records with each weekday (Ugedag) like this: +--------+-----------------+------------------+-----------------+------------------+-----+ | holdId | startSlutMandag | startSlutTirsdag | startSlutOnsdag | startSlutTorsdag | ... |+--------+-----------------+------------------+-----------------+------------------+-----+| 1587b1 | 09:00 - 15:30 | | | | ... |+--------+-----------------+------------------+-----------------+------------------+-----+| 1587b1 | | 08:00 - 15:00 | | | ... |+--------+-----------------+------------------+-----------------+------------------+-----+| 1587b1 | | | 08:30 - 18:00 | | ... |+--------+-----------------+------------------+-----------------+------------------+-----+| 1587b1 | | | | 15:00 - 04:00 | ... |+--------+-----------------+------------------+-----------------+------------------+-----+ But i need the days to be in the same record, like this: +--------+-----------------+------------------+-----------------+------------------+-----+| holdId | startSlutMandag | startSlutTirsdag | startSlutOnsdag | startSlutTorsdag | ... |+--------+-----------------+------------------+-----------------+------------------+-----+| 1587b1 | 09:00 - 15:30 | 08:00 - 15:00 | 08:30 - 18:00 | 15:00 - 04:00 | ... |+--------+-----------------+------------------+-----------------+------------------+-----+ Some sample data from the db: Any ideas? data.txt
  2. Hello I need to delete array items and compact the array (multidimentional). I have not been able to find any "build in" function for this in VBScript. I would like to be able to "delete" array items and compact the remaining items so there is no gaps. Array example: Dim example(4,20) example(0,0) = "54HG12-KLD"example(1,0) = "Thingamabob"example(2,0) = "Good for long hikes."example(3,0) = "599" example(0,1) = "54HG12-GHJ"example(1,1) = "Thingamabob"example(2,1) = "Good for short hikes."example(3,1) = "499"... Does anyone have a function er code snippet, or maybe some good advice on writing a function to tackle this. Kind regards Mads
  3. Hello Imports System.Web.Script.SerializationImports System.Data.SqlClientPublic Class jsonTest Dim objSQLConnection As SqlConnection Dim objSQLCommand As SqlCommand Dim objSQLDataReader As SqlDataReader Dim objJSONStringBuilder As StringBuilder Public Function returnJson() As String Dim col1 As New ArrayList Dim col2 As New ArrayList objJSONStringBuilder = New StringBuilder() Dim connString As String = System.Configuration.ConfigurationManager.ConnectionStrings("VUCConnectionString").ConnectionString objSQLConnection = New SqlConnection(System.Configuration.ConfigurationManager.AppSettings(connString)) objSQLCommand = New SqlCommand("select col1, col2 from table1", objSQLConnection) objSQLCommand.Connection.Open() objSQLDataReader = objSQLCommand.ExecuteReader() While objSQLDataReader.Read() col1.Add(objSQLDataReader("col1")) End While objSQLDataReader.Close() objSQLCommand.Connection.Close() Dim serializer As New JavaScriptSerializer() Dim arrayJson As String = serializer.Serialize(col1) Return arrayJson End FunctionEnd ClassPublic Class wwwroot_Default Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim jsontest As New jsonTest() Dim test As String = jsontest.returnJson() jsonOutput.Text = test End SubEnd Class I am trying to return JSON data from the database, this is _so_ easy with PHP, but i am forced to use ASP.NET I am gettting the following error from the code above: The ConnectionString property has not been initialized.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.InvalidOperationException: The ConnectionString property has not been initialized.Source Error:Line 22: objSQLCommand = New SqlCommand("select col1, col2 from table1", objSQLConnection)Line 23:Line 24: objSQLCommand.Connection.Open()Line 25: objSQLDataReader = objSQLCommand.ExecuteReader()Line 26: Source File: [url="file://\WebfilefswebsitesDATAPOOL006u12ekgqwwwrootDefault.aspx.vb"]\\Webfilefs\websites\DATAPOOL006\u12ekgq\wwwroot\Default.aspx.vb[/url] Line: 24 Everything seems fine in the editor, and i know the connection string is working, at least on other sites. Any suggestions are most welcome, and please, if there is an easier way of doing this, ala PHP, please enlighten me. Kind regards Mads Nielsen
  4. Found the problem now. My test site test.htm was making the browser operate in quirks mode, and the navigator object don't contain the same information in that mode.With quirks mode enabled: { "appCodeName": "Mozilla", "appMinorVersion": "0", "appName": "Microsoft Internet Explorer", "appVersion": "5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)", "cookieEnabled": true, "cpuClass": "x86", "mimeTypes": {}, "msDoNotTrack": "0", "onLine": true, "opsProfile": {}, "platform": "Win32", "plugins": {"length": 0}, "systemLanguage": "da", "userAgent": "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)", "userLanguage": "da", "userProfile": [circular]} IE9 Standards [object Navigator]{appCodeName: "Mozilla",appMinorVersion: "0",appName: "Microsoft Internet Explorer",appVersion: "5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)",browserLanguage: "en-us",cookieEnabled: true,cpuClass: "x86",geolocation: [object Geolocation],javaEnabled: function javaEnabled() { [native code]},mimeTypes: [object MSMimeTypesCollection],msDoNotTrack: "0",onLine: true,platform: "Win32",plugins: [object MSPluginsCollection],systemLanguage: "da",taintEnabled: function taintEnabled() { [native code]},userAgent: "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)",userLanguage: "da"} If somebody know why the object don't contain the same data and methods, please explain.
  5. I am using the developer tool in IE9 (F12), this is what i get from navigator:[object navigator]appCodeName: "Mozilla"appMinorVersion: "0"appName: "Microsoft Internet Explorer"browserLanguage: "en-us"cookieEnabled: truecpuClass: "x86"getlocation: [object Geolocation]javaEnabled:function javaEnabled() {[native code]}mimeTypes: [object MSMimeTypesCollection]msDoNotTrack: "0"onLine: trueplatform: "Win32"plugins: [object MSPluginsCollection]systemLanguage: "da"taintEnabled:function taintEnabled() {[native code]}userAgent: "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)"userLanguage: "da" Thats pretty far from the output i get when i am using the function, but its exactly what i get on jsconsole.com
  6. I dont want JSON, i just want a representation of the the object i put into the function. The firefox output above is perfect, i just dont understand why the output is not simila in FF and IE. it is on jsconsole.com, but when i use the function i get different outputs. The output in IE should be equal to this:[object Navigator]{appCodeName: "Mozilla",appMinorVersion: "0",appName: "Microsoft Internet Explorer",appVersion: "5.0 (compatible; MSIE 9.0; Windows NT 6.0; WOW64; Trident/5.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.30729; .NET CLR 3.5.30729; .NET4.0C)",browserLanguage: "en-us",cookieEnabled: true,cpuClass: "x86",geolocation: [object Geolocation],javaEnabled:function javaEnabled() {[native code]},mimeTypes: [object MSMimeTypesCollection],msDoNotTrack: "0",onLine: true,platform: "Win32",plugins: [object MSPluginsCollection],systemLanguage: "da",taintEnabled:function taintEnabled() {[native code]},userAgent: "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; WOW64; Trident/5.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.30729; .NET CLR 3.5.30729; .NET4.0C)",userLanguage: "da"} The output from the function should be exactly like the above, its taken from jsconsole.com
  7. Go to jsconsole.com and type navigator, both in IE and Firefox, the function produce equal output. But when i use the function Its the Firefox output that is correct. Also, try to press F12 in IE9, then under script, type "navigator" and evaluate that, then add the output to the watch list. the function should produce the same output, like in Firefox.
  8. Hello I have these JavaScript functions from http://jsconsole.com/ They are supposed to stringify a object and display it as JSON. <html><head> <title></title> <script type="text/javascript"> function sortci(a, { return a.toLowerCase() < b.toLowerCase() ? -1 : 1; } function stringify(o, simple, visited) { var json = '', i, vi, type = '', parts = [], names = [], circular = false; visited = visited || []; try { type = ({}).toString.call(o); } catch (e) { // only happens when typeof is protected (...randomly) type = '[object Object]'; } // check for circular references for (vi = 0; vi < visited.length; vi++) { if (o === visited[vi]) { circular = true; break; } } if (circular) { json = '[circular]'; } else if (type == '[object String]') { json = '"' + o.replace(/"/g, '\\"') + '"'; } else if (type == '[object Array]') { visited.push(o); json = '['; for (i = 0; i < o.length; i++) { parts.push(stringify(o[i], simple, visited)); } json += parts.join(', ') + ']'; json; } else if (type == '[object Object]') { visited.push(o); json = '{'; for (i in o) { names.push(i); } names.sort(sortci); for (i = 0; i < names.length; i++) { parts.push(stringify(names[i], undefined, visited) + ': ' + stringify(o[names[i]], simple, visited)); } json += parts.join(', ') + '}'; } else if (type == '[object Number]') { json = o + ''; } else if (type == '[object Boolean]') { json = o ? 'true' : 'false'; } else if (type == '[object Function]') { json = o.toString(); } else if (o === null) { json = 'null'; } else if (o === undefined) { json = 'undefined'; } else if (simple == undefined) { visited.push(o); json = type + '{'; for (i in o) { names.push(i); } names.sort(sortci); for (i = 0; i < names.length; i++) { try { parts.push(names[i] + ': ' + stringify(o[names[i]], true, visited)); // safety from max stack } catch (e) { if (e.name == 'NS_ERROR_NOT_IMPLEMENTED') { // do nothing - not sure it's useful to show this error when the variable is protected // parts.push(names[i] + ': NS_ERROR_NOT_IMPLEMENTED'); } } } json += parts.join(',\n') + '\n}'; } else { try { json = o + ''; // should look like an object } catch (e) { } } return json; } </script> <script type="text/javascript"> function dispSerial() { document.write("<pre>" + stringify(navigator) + "</pre>"); } </script></head><body onload="dispSerial()"></body></html> I get different output in IE9 and Firefox, i know that some of the methods don't contain the same information across different browsers, but the output is radically different. IE9 {"appCodeName": "Mozilla","appMinorVersion": "0","appName": "Microsoft Internet Explorer","appVersion": "5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)","cookieEnabled": true,"cpuClass": "x86","mimeTypes": {},"msDoNotTrack": "0","onLine": true,"opsProfile": {},"platform": "Win32","plugins": {"length": 0},"systemLanguage": "da","userAgent": "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)", "userLanguage": "da","userProfile": [circular]} Firefox 7.0.1 [object Navigator]{appCodeName: "Mozilla",appName: "Netscape",appVersion: "5.0 (Windows)",buildID: "20110928134238",cookieEnabled: true,geolocation: [object GeoGeolocation],javaEnabled: function javaEnabled() { [native code]},language: "en-US",mimeTypes: [object MimeTypeArray],mozIsLocallyAvailable: function mozIsLocallyAvailable() { [native code]},onLine: true,oscpu: "Windows NT 6.1",platform: "Win32",plugins: [object PluginArray],product: "Gecko",productSub: "20100101",registerContentHandler: function registerContentHandler() { [native code]},registerProtocolHandler: function registerProtocolHandler() { [native code]},taintEnabled: function taintEnabled() { [native code]},userAgent: "Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1",vendor: "",vendorSub: ""} The output in Firefox is correct, but the output in IE9 is missing some of the methods, e.g. geolocation etc. The strange thing is that the stringify function works on http://jsconsole.com/ in IE9 type "navigator" in the console and see for yourself. Any suggestions ?
  9. HelloI have some data in a Gridview, selection is enabled, i need to be able to select a row and get the content of the first cell from that row. Here is the code: Public Sub codeGridView_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles GridView1.RowCommand Dim row As GridViewRow = GridView1.SelectedRow Response.Write(row.Cells(1).Text) End Sub I have this property set in the GridView control: onselectedindexchanged="codeGridView_SelectedIndexChanged" There is no errors in the IDE but when i try to select a row the browser quits and i get this error in the IDE: NullReferenceException was unhandled by user code.Object reference not set to an instance of an object. Whats wrong ?Any help is greatly appreciated.Kind regards Mads Nielsen
  10. I did it.This is a fully working example. <html><head><title></title></head> <body><h1>eBay RSS feed</h1> <div id="feed"> <button onclick="getFeed()">Get data</button><br /> <span id="to"></span> </div> <script type="text/javascript"> function getFeed() { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { txt = xmlhttp.responseText; if (window.DOMParser) { parser = new DOMParser(); xmlDoc = parser.parseFromString(txt, "text/xml"); } else // Internet Explorer { xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = "false"; xmlDoc.loadXML(txt); } document.getElementById("to").innerHTML = xmlDoc.getElementsByTagName("title")[4].childNodes[0].nodeValue; } } xmlhttp.open("GET", "http://computers.shop.ebay.com/Computers-Networking-/58058/i.html?rt=nc&_nkw=hp+vectra&_npmv=3&_rss=1", true); xmlhttp.send(); }</script> </body></html> :)I just needed to turn the data from responseText into a XMLdom object./mads
  11. Here is a little snippet of the data i get back from responseText: <?xml version="1.0" encoding="UTF-8" ?><rss version="2.0" xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" xmlns:g="http://base.google.com/ns/1.0" xmlns:rx="urn:ebay:apis:eBLBaseComponents"><!--About this feed===============This page is an RSS feed that provides the listings that satisfy the query you entered.Once you have subscribed to this feed, you will receive automatic updates any time a new listing appears in this store.To learn more about feeds, copy and paste the below link in your browserhttp://pages.ebay.com/help/welcome/contextual/rss.htmlHow to subscribe to this feed=============================You will need an RSS reader. To subscribe copy and Paste the URL of this page into your reader, and follow the instructions provided for that reader.--><channel><title><![CDATA[hp vectra(Category:Computers & Networking)]]></title><cf:treatAs xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005">list</cf:treatAs><link><![CDATA[http://computers.shop.ebay.com/Computers-Networking-/58058/i.html?_nkw=hp+vectra&_npmv=3&ssPageName=RSS:B:SHOP:US:100]]></link><description><![CDATA[hp vectra(Category:Computers & Networking)]]></description><language>en</language><ttl>60</ttl><image><url><![CDATA[http://pics.ebaystatic.com/aw/pics/navbar/eBayLogoTM.gif]]></url><link><![CDATA[http://computers.shop.ebay.com/Computers-Networking-/58058/i.html?_nkw=hp+vectra&_npmv=3&ssPageName=RSS:B:SHOP:US:100]]></link><title><![CDATA[hp vectra(Category:Computers & Networking)]]></title></image><cf:listinfo xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005"><cf:sort ns="urn:ebay:apis:eBLBaseComponents" label="Buy It Now price" element="BuyItNowPrice" data-type="number" default="no"></cf:sort><cf:sort ns="urn:ebay:apis:eBLBaseComponents" label="Current auction price" element="CurrentPrice" data-type="number" default="no"></cf:sort><cf:sort ns="urn:ebay:apis:eBLBaseComponents" label="Listing end time" element="EndTime" data-type="number" default="no"></cf:sort><cf:sort ns="urn:ebay:apis:eBLBaseComponents" label="Number of bids" element="BidCount" data-type="number" default="no"></cf:sort><cf:group ns="urn:ebay:apis:eBLBaseComponents" label="listing format" element="AuctionType"></cf:group><cf:group ns="urn:ebay:apis:eBLBaseComponents" label="option" element="ItemCharacteristic"></cf:group><cf:group ns="urn:ebay:apis:eBLBaseComponents" label="listing category" element="Category"></cf:group></cf:listinfo><item><title><![CDATA[HP Vectra XU90 dual Pentium 133 computer, 160 MB RAM]]></title><link><![CDATA[http://cgi.ebay.com/HP-Vectra-XU90-dual-Pentium-133-computer-160-MB-RAM-/220781305768?pt=Desktop_PCs&hash=item3367975fa8&ssPageName=RSS:B:SHOP:US:101]]></link><description><![CDATA[<table border="0" cellpadding="8"><tr><td width="80px"><a href="http://cgi.ebay.com/HP-Vectra-XU90-dual-Pentium-133-computer-160-MB-RAM-/220781305768?pt=Desktop_PCs&hash=item3367975fa8&ssPageName=RSS:B:SHOP:US:102"><img border="0" src="http://thumbs1.ebaystatic.com/m/mT2Wxds2YLwXWCbFRqM2bVQ/80.jpg"></a></td><td><strong>$9.99</strong> (0 Bids)<br>End Date: Sunday May-15-2011 18:40:47 PDT<br><a href="http://cgi.ebay.com/HP-Vectra-XU90-dual-Pentium-133-computer-160-MB-RAM-/220781305768?pt=Desktop_PCs&hash=item3367975fa8&ssPageName=RSS:B:SHOP:US:103">Bid now</a> | <a href="http://cgi1.ebay.com/ws/eBayISAPI.dll?MfcISAPICommand=MakeTrack&item=220781305768&ssPageName=RSS:B:SHOP:US:104">Add to watch list</a></td></tr></table>]]></description><guid isPermaLink="false"><![CDATA[http://cgi.ebay.com/HP-Vectra-XU90-dual-Pentium-133-computer-160-MB-RAM-/220781305768?pt=Desktop_PCs&hash=item3367975fa8&ssPageName=RSS:B:SHOP:US:101]]></guid><pubDate>Sun, 08 May 2011 18:40:47 PDT</pubDate><rx:CurrentPrice xmlns:rx="urn:ebay:apis:eBLBaseComponents">999</rx:CurrentPrice><rx:EndTime xmlns:rx="urn:ebay:apis:eBLBaseComponents">1305510047000</rx:EndTime><rx:BidCount xmlns:rx="urn:ebay:apis:eBLBaseComponents">0</rx:BidCount><rx:Category xmlns:rx="urn:ebay:apis:eBLBaseComponents"><![CDATA[PC Desktops]]></rx:Category><rx:AuctionType xmlns:rx="urn:ebay:apis:eBLBaseComponents">Auction</rx:AuctionType><rx:ItemCharacteristic xmlns:rx="urn:ebay:apis:eBLBaseComponents">Listed with PayPal</rx:ItemCharacteristic></item><item><title><![CDATA[HP VECTRA XE320 P4 1.7GHz 256MB 20GB CD-ROM Complete]]></title><link><![CDATA[http://cgi.ebay.com/HP-VECTRA-XE320-P4-1-7GHz-256MB-20GB-CD-ROM-Complete-/200376329536?pt=Desktop_PCs&hash=item2ea75c2540&ssPageName=RSS:B:SHOP:US:101]]></link><description><![CDATA[<table border="0" cellpadding="8"><tr><td width="80px"><a href="http://cgi.ebay.com/HP-VECTRA-XE320-P4-1-7GHz-256MB-20GB-CD-ROM-Complete-/200376329536?pt=Desktop_PCs&hash=item2ea75c2540&ssPageName=RSS:B:SHOP:US:102"><img border="0" src="http://thumbs1.ebaystatic.com/m/mHVOiUcsJ8BJjYgA6sIkocA/80.jpg"></a></td><td><strong>$119.00</strong><br>End Date: Tuesday Jun-14-2011 7:24:13 PDT<br>Buy It Now for only: US $119.00<br><a href="http://cgi.ebay.com/HP-VECTRA-XE320-P4-1-7GHz-256MB-20GB-CD-ROM-Complete-/200376329536?pt=Desktop_PCs&hash=item2ea75c2540&ssPageName=RSS:B:SHOP:US:105">Buy it now</a> | <a href="http://cgi1.ebay.com/ws/eBayISAPI.dll?MfcISAPICommand=MakeTrack&item=200376329536&ssPageName=RSS:B:SHOP:US:104">Add to watch list</a></td></tr></table>]]></description><guid isPermaLink="false"><![CDATA[http://cgi.ebay.com/HP-VECTRA-XE320-P4-1-7GHz-256MB-20GB-CD-ROM-Complete-/200376329536?pt=Desktop_PCs&hash=item2ea75c2540&ssPageName=RSS:B:SHOP:US:101]]></guid><pubDate>Sun, 23 Aug 2009 07:19:13 PDT</pubDate><rx:BuyItNowPrice xmlns:rx="urn:ebay:apis:eBLBaseComponents">11900</rx:BuyItNowPrice><rx:CurrentPrice xmlns:rx="urn:ebay:apis:eBLBaseComponents">11900</rx:CurrentPrice><rx:EndTime xmlns:rx="urn:ebay:apis:eBLBaseComponents">1308061453000</rx:EndTime><rx:BidCount xmlns:rx="urn:ebay:apis:eBLBaseComponents">0</rx:BidCount><rx:Category xmlns:rx="urn:ebay:apis:eBLBaseComponents"><![CDATA[PC Desktops]]></rx:Category><rx:AuctionType xmlns:rx="urn:ebay:apis:eBLBaseComponents">Buy it now</rx:AuctionType><rx:ItemCharacteristic xmlns:rx="urn:ebay:apis:eBLBaseComponents">Listed with PayPal</rx:ItemCharacteristic></item><item><title><![CDATA[HP VECTRA XE320 P4 1.7GHz 256MB 20GB CD-ROM Complete]]></title><link><![CDATA[http://cgi.ebay.com/HP-VECTRA-XE320-P4-1-7GHz-256MB-20GB-CD-ROM-Complete-/200382330106?pt=Desktop_PCs&hash=item2ea7b7b4fa&ssPageName=RSS:B:SHOP:US:101]]></link><description><![CDATA[<table border="0" cellpadding="8"><tr><td width="80px"><a href="http://cgi.ebay.com/HP-VECTRA-XE320-P4-1-7GHz-256MB-20GB-CD-ROM-Complete-/200382330106?pt=Desktop_PCs&hash=item2ea7b7b4fa&ssPageName=RSS:B:SHOP:US:102"><img border="0" src="http://thumbs1.ebaystatic.com/m/mHVOiUcsJ8BJjYgA6sIkocA/80.jpg"></a></td><td><strong>$178.95</strong><br>End Date: Wednesday Jun-01-2011 15:05:08 PDT<br>Buy It Now for only: US $178.95<br><a href="http://cgi.ebay.com/HP-VECTRA-XE320-P4-1-7GHz-256MB-20GB-CD-ROM-Complete-/200382330106?pt=Desktop_PCs&hash=item2ea7b7b4fa&ssPageName=RSS:B:SHOP:US:105">Buy it now</a> | <a href="http://cgi1.ebay.com/ws/eBayISAPI.dll?MfcISAPICommand=MakeTrack&item=200382330106&ssPageName=RSS:B:SHOP:US:104">Add to watch list</a></td></tr></table>]]></description><guid isPermaLink="false"><![CDATA[http://cgi.ebay.com/HP-VECTRA-XE320-P4-1-7GHz-256MB-20GB-CD-ROM-Complete-/200382330106?pt=Desktop_PCs&hash=item2ea7b7b4fa&ssPageName=RSS:B:SHOP:US:101]]></guid><pubDate>Wed, 09 Sep 2009 15:00:08 PDT</pubDate><rx:BuyItNowPrice xmlns:rx="urn:ebay:apis:eBLBaseComponents">17895</rx:BuyItNowPrice><rx:CurrentPrice xmlns:rx="urn:ebay:apis:eBLBaseComponents">17895</rx:CurrentPrice><rx:EndTime xmlns:rx="urn:ebay:apis:eBLBaseComponents">1306965908000</rx:EndTime><rx:BidCount xmlns:rx="urn:ebay:apis:eBLBaseComponents">0</rx:BidCount><rx:Category xmlns:rx="urn:ebay:apis:eBLBaseComponents"><![CDATA[PC Desktops]]></rx:Category><rx:AuctionType xmlns:rx="urn:ebay:apis:eBLBaseComponents">Buy it now</rx:AuctionType><rx:ItemCharacteristic xmlns:rx="urn:ebay:apis:eBLBaseComponents">Listed with PayPal</rx:ItemCharacteristic><rx:ItemCharacteristic xmlns:rx="urn:ebay:apis:eBLBaseComponents">Best Offer</rx:ItemCharacteristic></item><item><title><![CDATA[HP VECTRA XE310 P3 1GHz 256MB 20GB CD-ROM Complete Unit]]></title><link><![CDATA[http://cgi.ebay.com/HP-VECTRA-XE310-P3-1GHz-256MB-20GB-CD-ROM-Complete-Unit-/360182515590?pt=Desktop_PCs&hash=item53dc8d0786&ssPageName=RSS:B:SHOP:US:101]]></link><description><![CDATA[<table border="0" cellpadding="8"><tr><td width="80px"><a href="http://cgi.ebay.com/HP-VECTRA-XE310-P3-1GHz-256MB-20GB-CD-ROM-Complete-Unit-/360182515590?pt=Desktop_PCs&hash=item53dc8d0786&ssPageName=RSS:B:SHOP:US:102"><img border="0" src="http://thumbs3.ebaystatic.com/m/mVpJ6uPUfmIgMmMyAtrkPiA/80.jpg"></a></td><td><strong>$99.00</strong><br>End Date: Tuesday Jun-14-2011 7:22:35 PDT<br>Buy It Now for only: US $99.00<br><a href="http://cgi.ebay.com/HP-VECTRA-XE310-P3-1GHz-256MB-20GB-CD-ROM-Complete-Unit-/360182515590?pt=Desktop_PCs&hash=item53dc8d0786&ssPageName=RSS:B:SHOP:US:105">Buy it now</a> | <a href="http://cgi1.ebay.com/ws/eBayISAPI.dll?MfcISAPICommand=MakeTrack&item=360182515590&ssPageName=RSS:B:SHOP:US:104">Add to watch list</a></td></tr></table>]]></description><guid isPermaLink="false"><![CDATA[http://cgi.ebay.com/HP-VECTRA-XE310-P3-1GHz-256MB-20GB-CD-ROM-Complete-Unit-/360182515590?pt=Desktop_PCs&hash=item53dc8d0786&ssPageName=RSS:B:SHOP:US:101]]></guid><pubDate>Sun, 23 Aug 2009 07:17:35 PDT</pubDate><rx:BuyItNowPrice xmlns:rx="urn:ebay:apis:eBLBaseComponents">9900</rx:BuyItNowPrice><rx:CurrentPrice xmlns:rx="urn:ebay:apis:eBLBaseComponents">9900</rx:CurrentPrice><rx:EndTime xmlns:rx="urn:ebay:apis:eBLBaseComponents">1308061355000</rx:EndTime><rx:BidCount xmlns:rx="urn:ebay:apis:eBLBaseComponents">0</rx:BidCount><rx:Category xmlns:rx="urn:ebay:apis:eBLBaseComponents"><![CDATA[PC Desktops]]></rx:Category><rx:AuctionType xmlns:rx="urn:ebay:apis:eBLBaseComponents">Buy it now</rx:AuctionType><rx:ItemCharacteristic xmlns:rx="urn:ebay:apis:eBLBaseComponents">Listed with PayPal</rx:ItemCharacteristic></item>... If there was a cross domain problem, i would get no data at all./mads
  12. I dont think so. I get the content of response.Text into the textarea just fine. If it was a cross domain issue i would get "Access denied"Theres only a problem when i use responseXML, although the RSS XML validates./mads
  13. HelloI am trying to generate an array of the data in xmlhttp.responseXML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Untitled Page</title> <script type="text/javascript"> function getFeed() { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById("text").value = xmlhttp.responseText; //xmlDoc = xmlhttp.responseXML; //alert(xmlDoc.length); //document.getElementById("text").value = xmlDoc.getElementsByTagName("title")[0].nodeValue; } } xmlhttp.open("GET", "http://computers.shop.ebay.com/Computers-Networking-/58058/i.html?rt=nc&_nkw=hp+vectra&_npmv=3&_rss=1", true); xmlhttp.send(); } </script> </head> <body><h1>eBay RSS feed</h1> <div id="feed"> <button onclick="getFeed()">Get data</button><br /> <br /><textarea rows="40" cols="150" id="text"></textarea> </div> </body></html> The above code just gets the RSS data from ebay and displays it in the textarea. The parts that have been commented out is where i try to put all the data from xmlhttp.responseXML into an array, i can't seem to make it work. Webpage error detailsUser Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)Timestamp: Sat, 14 May 2011 18:02:57 UTCMessage: Object requiredLine: 25Char: 25Code: 0URI: file:///C:/Users/user/Desktop/ebayRSSjs.htm Whats the problem here ?/mads
  14. HelloI have this array: Array(40) [0]=> widget [1]=> debug [2]=> on [3]=> window [4]=> title [5]=> Sample Konfabulator Widget [6]=> name [7]=> main_window [8]=> width [9]=> 500 [10]=> height [11]=> 500 [12]=> image [13]=> src [14]=> Images/Sun.png [15]=> name [16]=> sun1 [17]=> hOffset [18]=> 250 [19]=> vOffset [20]=> 250 [21]=> alignment [22]=> center [23]=> text [24]=> data [25]=> Click Here [26]=> size [27]=> 36 [28]=> style [29]=> bold [30]=> name [31]=> text1 [32]=> hOffset [33]=> 250 [34]=> vOffset [35]=> 100 [36]=> alignment [37]=> center [38]=> onMouseUp [39]=> sun1.opacity = (sun1.opacity / 100) * 90; The output above is from my PHP inspired var_dump() functionHow do i remove every other key from it, beginning with [1]debugI can't seem to wrap my head around it at the moment :)Any suggestions are welcome./mads
  15. I deleted the whole <style> section and added it again. it works now.Thansk
×
×
  • Create New...