Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › Set java variable to JSON on a webpage
New Posts  All Forums:Forum Nav:

Set java variable to JSON on a webpage

post #1 of 2
Thread Starter 
Say a page at html://fake.com contains
{"first":"Bob",
"last":"Bob"}

How would I go about setting a javascript var to this JSON data stored at this URL?
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 G0 @ 3.0GHz/1.17V GA-P35-DS3L BFG GTX 295 A-DATA 2x2GB DDR2 800 
Hard DriveOSMonitorKeyboard
WD 640GB Windows 7 Ultimate x64 2x AL1917W G15 v2 
PowerCaseMouseMouse Pad
OCZ 700W GamerXStream Modded Rocketfish "Lian-Li" w GTX480 Logitech G9x Rocketfish 
  hide details  
Reply
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 G0 @ 3.0GHz/1.17V GA-P35-DS3L BFG GTX 295 A-DATA 2x2GB DDR2 800 
Hard DriveOSMonitorKeyboard
WD 640GB Windows 7 Ultimate x64 2x AL1917W G15 v2 
PowerCaseMouseMouse Pad
OCZ 700W GamerXStream Modded Rocketfish "Lian-Li" w GTX480 Logitech G9x Rocketfish 
  hide details  
Reply
post #2 of 2
Do you want to use jQuery or straight javascript?
Here's link to jQuery JSON, it's pretty straight forward
Main PC
(13 items)
 
  
CPUMotherboardGraphicsRAM
i5 2500k Asus Maximus IV Gene-Z MSI 6950 2gb Unlocked Ref GSkill Ripjaws X 8GB CL8 
Hard DriveOSMonitorKeyboard
Crucial M4 128GB Windows 7 Ult Samsung 24" ToC Das Professional Silent 
PowerCaseMouse
Seasonic X750 Corsair 650d Logitech G700 
  hide details  
Reply
Main PC
(13 items)
 
  
CPUMotherboardGraphicsRAM
i5 2500k Asus Maximus IV Gene-Z MSI 6950 2gb Unlocked Ref GSkill Ripjaws X 8GB CL8 
Hard DriveOSMonitorKeyboard
Crucial M4 128GB Windows 7 Ult Samsung 24" ToC Das Professional Silent 
PowerCaseMouse
Seasonic X750 Corsair 650d Logitech G700 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Web Coding
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › Set java variable to JSON on a webpage