asp.net mvc 3 - How to create a javascript string in razor -
I have seen some posts about this subject and some blogs, but no one is able to mention my output . / P>
I have to create a Google map map with information about what I want. That part works to manually enter the information results in the correct information.
Where am I stuck when I'm going dynamiccaly with the javascript array string information I want on my map.
I have to get the HTML code:
& lt; Script type = "text / javascript" & gt; Var Projects = [['Contour 4.1 Besthande Bu', 52.25446, 6.16024700000003, 'Devender', '', Consultant, 'Rating 30'], ['School Nyaya 4.0', 52.243161, 4.43677860000003, 'Nordwijk', '', Consultant ',' rating 30 '],];
Very simple JavaScript array, which I thought was:
& lt; Script type = "text / javascript" & gt; Var Projects = [[Priority in Model] {@ HttpUtility.JavaScriptStringEncode ("[" + item.Gebouwnaam + "',' + item.LocatieLatitude.ToString (). Change (", ",". ") +" , "+ Item.LocatieLongitude.ToString (). Change (", ",". ") +", "" + Items.plats + "'," "+ item.girruckfacty +"', '"+ item .Licentiehouder
Although it gives me:
& lt; script type = "text / javascript"> Var Projects = [[\ u0027 Contour 4.1 Bestende Bruu, 52.25446, 6.16024700000003, \ u0027Deventer \ u0027, \ u0027 \ "\ u0027advursurs \ u0027, \ U0027rating30 \ u0027], [\ u0027 School Nyaya 4.0 \ u0027, 52.243161, 4.43677860000003 , \ U0027 Nordwish \ u0027, \ u0027 \ u0027, \ u0027adviseurs \ u0027, \ u0027rating30 \ u0027]]]; & Lt; / Script & gt;
Avoid a single quote does not work What am I doing?
Tried with the bus
It worked and showed ...
& lt; Script type = "text / javascript" & gt; Var Projects = [['AAA', BBB '],]; & Lt; / Script & gt;
Comments
Post a Comment