JavaScript Global Variable Access in Debugger

I created a variable (var Foobar) outside any JavaScript code within a script tag at the top of my html source.  I launch the page, press F12 to open the IE Debugging tool.  After that I go to the debugger's console tab and type Foobar expecting to see its current value.  The debugger comes back telling me that the variable is undefined.

I am trying to do this so I can use such a variable which has a JSON array assigned to it to parseJSON (Foobar) somewhere in a JavaScript function I need to build.

Any ideas about all this would be greatly appreciated
LVL 1
Howard BashSenior Software EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rainer JeschorCommented:
Hi,
did you gave the variable an initial value?

If not then it is undefined.
var foobar;

Open in new window

==> Undefined

var foobar = '';

Open in new window

Should work.

HTH
Rainer
0
Howard BashSenior Software EngineerAuthor Commented:
I tried
var foobar = ''; and it didn't appear in debugger.  I am including entire HTML code here just in case there is something a bit more subtle I am missing.

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>jQueryStuff</title>


<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

<link rel="stylesheet" href="/resources/demos/style.css">

<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script src="https://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/2014.02/jquery.SPServices.min.js"></script>

<script language="javascript" type="text/javascript" src="../../mydocs_TEMP/Alexandria/Projects/MEC/JSONUtilities.js"

<script language="javascript" type="text/javascript">

//My Foobar variable
var WPQ7ListData = '';

$( document ).ready(function() {
		//alert( "ready!" );
		
	$(function() {
	
		$( "#datepicker" ).datepicker();
	
	  });						

});
	
//JSON DATA
WPQ7ListData = { "Row" : 
[{
"ID": "189",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21- ELIMS",
"FileLeafRef": "189_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002foperties\u002f189_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": " ccc Eliminations",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "190",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21001",
"FileLeafRef": "190_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002froperties\u002f190_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Tower",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "191",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21002",
"FileLeafRef": "191_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002erties\u002f191_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Tower 2",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "192",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21003",
"FileLeafRef": "192_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002roperties\u002f192_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Parking Garage",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "193",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21004",
"FileLeafRef": "193_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002froperties\u002f193_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Restaurant",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "194",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21005",
"FileLeafRef": "194_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002Properties\u002f194_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Conference",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "195",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21006",
"FileLeafRef": "195_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002Properties\u002f195_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Aq",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "196",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21007",
"FileLeafRef": "196_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002froperties\u002f196_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Smo",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "197",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21009",
"FileLeafRef": "197_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002roperties\u002f197_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Addr5",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "198",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21010",
"FileLeafRef": "198_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002Properties\u002f198_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Addr6",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "199",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21031",
"FileLeafRef": "199_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002fProperties\u002f199_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "North",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
],"FirstRow" : 1,
"LastRow" : 11
,"FilterLink" : "?FilterField1=Region&FilterValue1=New%20York&&PageFirstRow=1&"
,"FilterFields" : ";Region;"
,"ForceNoHierarchy" : "1"
,"HierarchyHasIndention" : ""

};


</script>

<script>
  $(function() {
    $( "#datepicker" ).datepicker();
  });
  
</script>

</head>

<body>

<p>Date: <input type="text" id="datepicker"></p>


 

</body>
</html>

Open in new window

0
Rainer JeschorCommented:
Hi,
in your HTML there are a couple of issues:
- Missing closing ">" and "</script>" in line 18
<script language="javascript" type="text/javascript" src="../../mydocs_TEMP/Alexandria/Projects/MEC/JSONUtilities.js"

Open in new window


- You load jQuery and jQuery UI two times in different versions - just load one version
- You run the datepicker function twice - you should run it only once
- Your WPQ7ListData array contains invalid / illegal characters (I am not sure which exactly) but at least Chrome and IE Debugging tools complained

The following updated HTML source finally works as expected:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>jQueryStuff</title>


<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

<link rel="stylesheet" href="/resources/demos/style.css">

<script src="//code.jquery.com/jquery-2.1.4.js"></script>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/2014.02/jquery.SPServices.min.js"></script>

<script language="javascript" type="text/javascript" src="../../mydocs_TEMP/Alexandria/Projects/MEC/JSONUtilities.js"></script>

<script language="javascript" type="text/javascript">

//My Foobar variable
var WPQ7ListData = '';

$( document ).ready(function() {
		//alert( "ready!" );
		
	$(function() {
	
		$( "#datepicker" ).datepicker();
	
	  });						

});
	
//JSON DATA
WPQ7ListData = { "Row" : 
[{
"ID": "189",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21- ELIMS",
"FileLeafRef": "189_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002foperties\u002f189_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": " ccc Eliminations",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "190",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21001",
"FileLeafRef": "190_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002foperties\u002f190_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Tower",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "191",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21002",
"FileLeafRef": "191_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002foperties\u002f191_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Tower 2",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "192",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21003",
"FileLeafRef": "192_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002foperties\u002f192_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Parking Garage",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "193",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21004",
"FileLeafRef": "193_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002froperties\u002f193_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Restaurant",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "194",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21005",
"FileLeafRef": "194_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002foperties\u002f194_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Conference",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "195",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21006",
"FileLeafRef": "195_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002foperties\u002f195_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Aq",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "196",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21007",
"FileLeafRef": "196_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002foperties\u002f196_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Smo",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "197",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21009",
"FileLeafRef": "197_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002foperties\u002f197_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Addr5",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "198",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21010",
"FileLeafRef": "198_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002foperties\u002f198_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Addr6",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "199",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21031",
"FileLeafRef": "199_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fSandbox\u002fLists\u002foperties\u002f199_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "North",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
],"FirstRow" : 1,
"LastRow" : 11
,"FilterLink" : "?FilterField1=Region&FilterValue1=New%20York&&PageFirstRow=1&"
,"FilterFields" : ";Region;"
,"ForceNoHierarchy" : "1"
,"HierarchyHasIndention" : ""

};


</script>

<script>
  $(function() {
    $( "#datepicker" ).datepicker();
  });
  
</script>

</head>

<body>

<p>Date: <input type="text" id="datepicker"></p>


 

</body>
</html>

Open in new window


And finally: if you use the above code on a SharePoint site, please remember:
- Do not use "$" as shortcut to jQuery, this might be overwritten on SharePoint pages depending on the activated/used features. Always use "jQuery" explicitly.
- Do not use document.ready event - instead write your code into a function and push that one to the built in _spbodyonloadfunctionnames (variable depends on SharePoint version)

HTH
Rainer
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Howard BashSenior Software EngineerAuthor Commented:
Hi,

I cleaned up the code and have included it here.  The Doc Ready event doesn't show the alert message and that variable doesn't appear to be visible to the debugger.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>jQueryStuff</title>

<script src="http://code.jquery.com/jquery-1.10.2.js"></script>

<script language="javascript" type="text/javascript" src="../../mydocs_TEMP/Alexandria/Projects/CNP/JSONUtilities.js" </script>

<script language="javascript" type="text/javascript">

var WPQ7ListData = '';

$(document).ready(function() {
		alert( "ready!" );		
});
	
//JSON DATA
WPQ7ListData = { "Row" : 
[{
"ID": "189",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21- ELIMS",
"FileLeafRef": "189_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f189_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "NY",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "190",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21001",
"FileLeafRef": "190_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f190_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "TW",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "191",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21002",
"FileLeafRef": "191_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f191_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "TE2",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "192",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21003",
"FileLeafRef": "192_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f192_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Garage",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "193",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21004",
"FileLeafRef": "193_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f193_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Cube",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "194",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21005",
"FileLeafRef": "194_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f194_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "center",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "195",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21006",
"FileLeafRef": "195_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f195_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "arium",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "196",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21007",
"FileLeafRef": "196_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f196_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "omplex",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "197",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21009",
"FileLeafRef": "197_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f197_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "NYr",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "198",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21010",
"FileLeafRef": "198_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f198_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "NYuu",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "199",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21031",
"FileLeafRef": "199_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f199_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "nt",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
],"FirstRow" : 1,
"LastRow" : 11
,"FilterLink" : "?FilterField1=Region&FilterValue1=New%20York&&PageFirstRow=1&"
,"FilterFields" : ";Region;"
,"ForceNoHierarchy" : "1"
,"HierarchyHasIndention" : ""

};


</script>

</head>

<body>

 

</body>
</html>

Open in new window

0
Howard BashSenior Software EngineerAuthor Commented:
I tried your code and it does show the 'WPQ7ListData' in window as true.  However,  the value it shows is '',  and not that large JSON string.

I am guessing that some simple within it is causing that assignment to fail.  If so,  this is a bit of an issue as the JSON is produced by SharePoint.  So, I need to handle the bad character(s) to get to the point of passing this to parseJSON.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>jQueryStuff</title>

<script src="http://code.jquery.com/jquery-1.10.2.js"></script>

<script language="javascript" type="text/javascript" src="../../mydocs_TEMP/Alexandria/Projects/CNP/JSONUtilities.js" </script>

<script language="javascript" type="text/javascript">

var WPQ7ListData = '';

$(document).ready(function() {
		alert( "ready!" );		
});
	
//JSON DATA
WPQ7ListData = { "Row" : 
[{
"ID": "189",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21- ELIMS",
"FileLeafRef": "189_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f189_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "NY",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "190",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21001",
"FileLeafRef": "190_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f190_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "TW",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "191",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21002",
"FileLeafRef": "191_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f191_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "TE2",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "192",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21003",
"FileLeafRef": "192_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f192_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Garage",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "193",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21004",
"FileLeafRef": "193_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f193_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "Cube",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "194",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21005",
"FileLeafRef": "194_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f194_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "center",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "195",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21006",
"FileLeafRef": "195_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f195_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "arium",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "196",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21007",
"FileLeafRef": "196_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f196_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "omplex",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "197",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21009",
"FileLeafRef": "197_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f197_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "NYr",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "198",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21010",
"FileLeafRef": "198_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f198_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "NYuu",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
,{
"ID": "199",
"PermMask": "0x7fffffffffffffff",
"FSObjType": "0",
"Title": "21031",
"FileLeafRef": "199_.000",
"Created_x0020_Date.ifnew": "",
"FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f199_.000",
"File_x0020_Type": "",
"File_x0020_Type.mapapp": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "",
"HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif",
"ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A",
"Active": "Yes",
"Region": "New York",
"Address_x0020_": "nt",
"CalcMonth": "October",
"Modified": "10\u002f19\u002f2015 1:24 PM",
"Modified.FriendlyDisplay": "0|October 19",
"CalcYear": "2015"
}
],"FirstRow" : 1,
"LastRow" : 11
,"FilterLink" : "?FilterField1=Region&FilterValue1=New%20York&&PageFirstRow=1&"
,"FilterFields" : ";Region;"
,"ForceNoHierarchy" : "1"
,"HierarchyHasIndention" : ""

};


</script>

</head>

<body>

 

</body>
</html>

Open in new window

0
Rainer JeschorCommented:
Hi,

"just" a simple typo:

Line 19
<script language="javascript" type="text/javascript" src="../../mydocs_TEMP/Alexandria/Projects/CNP/JSONUtilities.js" </script>

Open in new window

You miss the ">" at the end of the opening script tag.(after the src="...")

Should be
<script language="javascript" type="text/javascript" src="../../mydocs_TEMP/Alexandria/Projects/CNP/JSONUtilities.js"> </script>

Open in new window


JavaScript is very picky - one error and bumm.

HTH
Rainer
0
Julian HansenCommented:
Just a comment on $(document).ready and $(function ... they are essentially the same thing.

You don't need both (I personally prefer $(function ... as it is shorter) - but you can shorten your code from this

$( document ).ready(function() {
  //alert( "ready!" );
    $(function() {

Open in new window


To this
$(function() {
 ... // JQuery code here
});

Open in new window

0
Howard BashSenior Software EngineerAuthor Commented:
Hi,

Ok,  I put the right angle bracket on the script and now the alert message comes up and I can see my json variable when I type it's name into the console.

All good.  Now when I try to pass it to the parseJSON function it throws an error which I assume from what you previously mentioned is that some character in the json string is bad.  So,  I thought it was the back slash as that is an escape.  So I tried the following:

function GetPart(jdata) {	
	var jdataClean='';
	
	jdataClean = jdata.replace("\\", "\\\\");		
    var JSONDataObject = jQuery.parseJSON( jdataClean );	
}

Open in new window


The replace explodes and I don't get to the parseJSON call.
0
Rainer JeschorCommented:
Hi,
why do you want to parse it? It is already JSON and not a string.

If it was a string then it has to look like this:
WPQ7ListData = '{ "Row" : ' +
'[{"ID": "189","PermMask": "0x7fffffffffffffff","FSObjType": "0","Title": "21- ELIMS","FileLeafRef": "189_.000","Created_x0020_Date.ifnew": "","FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f189_.000","File_x0020_Type": "","File_x0020_Type.mapapp": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif","ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A","Active": "Yes","Region": "New York","Address_x0020_": "NY","CalcMonth": "October","Modified": "10\u002f19\u002f2015 1:24 PM","Modified.FriendlyDisplay": "0|October 19","CalcYear": "2015"}'+
',{"ID": "190","PermMask": "0x7fffffffffffffff","FSObjType": "0","Title": "21001","FileLeafRef": "190_.000","Created_x0020_Date.ifnew": "","FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f190_.000","File_x0020_Type": "","File_x0020_Type.mapapp": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif","ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A","Active": "Yes","Region": "New York","Address_x0020_": "TW","CalcMonth": "October","Modified": "10\u002f19\u002f2015 1:24 PM","Modified.FriendlyDisplay": "0|October 19","CalcYear": "2015"}'+
',{"ID": "191","PermMask": "0x7fffffffffffffff","FSObjType": "0","Title": "21002","FileLeafRef": "191_.000","Created_x0020_Date.ifnew": "","FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f191_.000","File_x0020_Type": "","File_x0020_Type.mapapp": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif","ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A","Active": "Yes","Region": "New York","Address_x0020_": "TE2","CalcMonth": "October","Modified": "10\u002f19\u002f2015 1:24 PM","Modified.FriendlyDisplay": "0|October 19","CalcYear": "2015"}'+
',{"ID": "192","PermMask": "0x7fffffffffffffff","FSObjType": "0","Title": "21003","FileLeafRef": "192_.000","Created_x0020_Date.ifnew": "","FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f192_.000","File_x0020_Type": "","File_x0020_Type.mapapp": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif","ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A","Active": "Yes","Region": "New York","Address_x0020_": "Garage","CalcMonth": "October","Modified": "10\u002f19\u002f2015 1:24 PM","Modified.FriendlyDisplay": "0|October 19","CalcYear": "2015"}'+
',{"ID": "193","PermMask": "0x7fffffffffffffff","FSObjType": "0","Title": "21004","FileLeafRef": "193_.000","Created_x0020_Date.ifnew": "","FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f193_.000","File_x0020_Type": "","File_x0020_Type.mapapp": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif","ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A","Active": "Yes","Region": "New York","Address_x0020_": "Cube","CalcMonth": "October","Modified": "10\u002f19\u002f2015 1:24 PM","Modified.FriendlyDisplay": "0|October 19","CalcYear": "2015"}'+
',{"ID": "194","PermMask": "0x7fffffffffffffff","FSObjType": "0","Title": "21005","FileLeafRef": "194_.000","Created_x0020_Date.ifnew": "","FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f194_.000","File_x0020_Type": "","File_x0020_Type.mapapp": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif","ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A","Active": "Yes","Region": "New York","Address_x0020_": "center","CalcMonth": "October","Modified": "10\u002f19\u002f2015 1:24 PM","Modified.FriendlyDisplay": "0|October 19","CalcYear": "2015"}'+
',{"ID": "195","PermMask": "0x7fffffffffffffff","FSObjType": "0","Title": "21006","FileLeafRef": "195_.000","Created_x0020_Date.ifnew": "","FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f195_.000","File_x0020_Type": "","File_x0020_Type.mapapp": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif","ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A","Active": "Yes","Region": "New York","Address_x0020_": "arium","CalcMonth": "October","Modified": "10\u002f19\u002f2015 1:24 PM","Modified.FriendlyDisplay": "0|October 19","CalcYear": "2015"}'+
',{"ID": "196","PermMask": "0x7fffffffffffffff","FSObjType": "0","Title": "21007","FileLeafRef": "196_.000","Created_x0020_Date.ifnew": "","FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f196_.000","File_x0020_Type": "","File_x0020_Type.mapapp": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif","ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A","Active": "Yes","Region": "New York","Address_x0020_": "omplex","CalcMonth": "October","Modified": "10\u002f19\u002f2015 1:24 PM","Modified.FriendlyDisplay": "0|October 19","CalcYear": "2015"}'+
',{"ID": "197","PermMask": "0x7fffffffffffffff","FSObjType": "0","Title": "21009","FileLeafRef": "197_.000","Created_x0020_Date.ifnew": "","FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f197_.000","File_x0020_Type": "","File_x0020_Type.mapapp": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif","ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A","Active": "Yes","Region": "New York","Address_x0020_": "NYr","CalcMonth": "October","Modified": "10\u002f19\u002f2015 1:24 PM","Modified.FriendlyDisplay": "0|October 19","CalcYear": "2015"}'+
',{"ID": "198","PermMask": "0x7fffffffffffffff","FSObjType": "0","Title": "21010","FileLeafRef": "198_.000","Created_x0020_Date.ifnew": "","FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f198_.000","File_x0020_Type": "","File_x0020_Type.mapapp": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif","ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A","Active": "Yes","Region": "New York","Address_x0020_": "NYuu","CalcMonth": "October","Modified": "10\u002f19\u002f2015 1:24 PM","Modified.FriendlyDisplay": "0|October 19","CalcYear": "2015"}'+
',{"ID": "199","PermMask": "0x7fffffffffffffff","FSObjType": "0","Title": "21031","FileLeafRef": "199_.000","Created_x0020_Date.ifnew": "","FileRef": "\u002fCNPSandbox\u002fLists\u002fCNPProperties\u002f199_.000","File_x0020_Type": "","File_x0020_Type.mapapp": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon": "","HTML_x0020_File_x0020_Type.File_x0020_Type.mapico": "icgen.gif","ContentTypeId": "0x010069518615D19E074DA43D189A28232A0A","Active": "Yes","Region": "New York","Address_x0020_": "nt","CalcMonth": "October","Modified": "10\u002f19\u002f2015 1:24 PM","Modified.FriendlyDisplay": "0|October 19","CalcYear": "2015"}'+
'],"FirstRow" : 1,"LastRow" : 11,"FilterLink" : "?FilterField1=Region&FilterValue1=New%20York&&PageFirstRow=1&","FilterFields" : ";Region;","ForceNoHierarchy" : "1","HierarchyHasIndention" : ""}';

Open in new window


And from what I have seen - in your original post it seems that some parts of the strings have been truncated.

The string \u002f is just the Unicode encoded value for a slash "/".

HTH
Rainer
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Howard BashSenior Software EngineerAuthor Commented:
After all the smoke and dust settled that last question was the answer.  The variable already was the JSON object and I can iterate the row array and get the fields contained within.

Geeze.

Thank you sir!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.