File tree Expand file tree Collapse file tree 3 files changed +33
-4
lines changed Expand file tree Collapse file tree 3 files changed +33
-4
lines changed Original file line number Diff line number Diff line change 1+ function  getParams ( )  { 
2+  var  url  =  window . location . href . slice ( window . location . href . indexOf ( '?' )  +  1 ) . split ( '&' ) ; 
3+  var  result  =  { } ; 
4+  url . forEach ( function ( item )  { 
5+  var  param  =  item . split ( "=" ) ; 
6+  result [ param [ 0 ] ]  =  param [ 1 ] ; 
7+  } ) ; 
8+  return  result ; 
9+ } 
10+  
111Survey . dxSurveyService . serviceUrl  =  "http://localhost:5000/api/Service" ; 
212var  accessKey  =  "" ; 
313var  editor  =  new  SurveyEditor . SurveyEditor ( "editor" ) ; 
4- var  url  =  new  URL ( document . URL ) ; 
5- var  surveyId  =  url . searchParams . get ( "id" ) ;  
14+ var  surveyId  =  getParams ( ) [ "id" ] ; 
615editor . loadSurvey ( surveyId ) ; 
716editor . saveSurveyFunc  =  function  ( saveNo ,  callback )  { 
817 var  xhr  =  new  XMLHttpRequest ( ) ; 
Original file line number Diff line number Diff line change 1+ function  getParams ( )  { 
2+  var  url  =  window . location . href . slice ( window . location . href . indexOf ( '?' )  +  1 ) . split ( '&' ) ; 
3+  var  result  =  { } ; 
4+  url . forEach ( function ( item )  { 
5+  var  param  =  item . split ( "=" ) ; 
6+  result [ param [ 0 ] ]  =  param [ 1 ] ; 
7+  } ) ; 
8+  return  result ; 
9+ } 
10+  
111function  SurveyManager ( baseUrl ,  accessKey )  { 
212 var  self  =  this ; 
313 var  url  =  new  URL ( document . URL ) ; 
4-  self . surveyId  =  url . searchParams . get ( "id" ) ;   
14+  self . surveyId  =  getParams ( ) [ "id" ] ; 
515 self . results  =  ko . observableArray ( ) ; 
616
717 self . loadResults  =  function  ( )  { 
Original file line number Diff line number Diff line change 1+ function  getParams ( )  { 
2+  var  url  =  window . location . href . slice ( window . location . href . indexOf ( '?' )  +  1 ) . split ( '&' ) ; 
3+  var  result  =  { } ; 
4+  url . forEach ( function ( item )  { 
5+  var  param  =  item . split ( "=" ) ; 
6+  result [ param [ 0 ] ]  =  param [ 1 ] ; 
7+  } ) ; 
8+  return  result ; 
9+ } 
10+  
111function  init ( )  { 
212
313 Survey . dxSurveyService . serviceUrl  =  "http://localhost:5000/api/Service" ; 
414 Survey . defaultBootstrapCss . navigationButton  =  "btn btn-primary" ; 
515 Survey . Survey . cssType  =  "bootstrap" ; 
616
717 var  url  =  new  URL ( document . URL ) ; 
8-  var  surveyId  =  url . searchParams . get ( "id" ) ;   
18+  var  surveyId  =  getParams ( ) [ "id" ] ; 
919 var  model  =  new  Survey . Model ( {  surveyId : surveyId ,  surveyPostId : surveyId  } ) ; 
1020 window . survey  =  model ; 
1121 model . render ( "surveyElement" ) ; 
                         You can’t perform that action at this time. 
           
                  
0 commit comments