Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by madsovenielsen

  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 '' En
  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
  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.AppSett
  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": {},
  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
  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)",browserLangu
  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]'; }
  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:
  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.onreadys
  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:/
  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"); } xml
  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
  15. I deleted the whole <style> section and added it again. it works now.Thansk
  16. HelloI am trying to import a stylesheet from another server <style type="text/css"> @import url("http://x.find.dk/default.css");</style> I have found some examples around the web, so this shouldt be possible.http://htmlhelp.com/reference/css/style-html.htmlhttp://www.howtocreate.co.uk/tutorials/css/externalfilesThe styles in default.css is not taking effect on the site i am trying to import it to.Whats wrong ?/mads
  17. Yeah. i do need to use it where i generate the json data :)Works now. :)/mads
  18. I dont think that will do the trick. Then the string will be displayed like:Mejlshede%20L%C3%A5se/N%C3%B8gler%20A/S Thats actually worse :)/mads
  19. HelloWe have a site with a form using search suggest on a text field.We are using the json2.js lib for parsing the data from a asp file over xmlHttpEverything is fine in IE7-9, Chrome, Safari. But Firefox have a charset problem.If the string from json2 contains æ ø or å they dont display right. The rest of the string is fine.Example: �Mejlshede L�se/N�gler A/S Theres only a problem if the data passes through json2.jsThe data in the database is encoded using ISO-8859-1Any help is greatly appriciated/mads
  20. Thanks all. Its working now. using only double quotes./mads
  21. I will try to use double quotes. I dont think it will be easy, we are using classic asp. so a single quote is used for comments :)/mads
  22. { "suggestResults" : [ {'name':'Grethe'},{'name':'Gerda'},{'name':'Gitte'},{'name':'Gudrun'},{'name':'Gunnar'},{'name':'Georg'},{'name':'Gert'},{'name':'Grete'},{'name':'Gustav'},{'name':'Gurli'},{'name':'dummy'}]} Based on this example on json.org var myJSONObject = {"bindings": [ {"ircEvent": "PRIVMSG", "method": "newURI", "regex": "^http://.*"}, {"ircEvent": "PRIVMSG", "method": "deleteURI", "regex": "^delete.*"}, {"ircEvent": "PRIVMSG", "method": "randomURI", "regex": "^random.*"} ]}; http://www.json.org/js.html/mads
  23. Im am now passing xmlhttp.responseText directly to JSON.parse()And i get the following error:Webpage error detailsUser Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)Timestamp: Mon, 10 Jan 2011 17:32:52 UTCMessage: Syntax errorLine: 25Char: 13Code: 0
  24. Okay. do you know what i am doing wrong ?/mads
  25. I now use Douglas Crockford's json2.js lib.function getData() { if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var json = xmlhttp.responseText; var test1 = JSON.stringify(json); //alert(test1); var testvar2 = JSON.parse(test1); //alert(testvar2); document.getElementById("name_dropdown").innerHTML = ""; var city_results = document.getElementById("name_dropdown"); var i = 0; whil
  • Create New...