• rickhugie
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

I am trying to use JSENCODE to get away from stored XSS security flags. When I use it I get an error  "Incorrect argument type for function 'JSENCODE()'"

 

I am not sure what I am getting wront on this. When I don't use JSENCODE the value comes out but when I wrap it in JSENCODE it gives the error when saving in Eclipse.  Below is my code snippet, thanks for the help in advance.

 

function initialize() {

 

    var myOptions = {

        zoom: 8,

        mapTypeId: google.maps.MapTypeId.ROADMAP,

        mapTypeControl: false

    }

    var locLat = {!JSENCODE(Location__c.Latitude__c)};

    var locLong = {!Location__c.Longitude__c};

    var myLatlng = new google.maps.LatLng(locLat, locLong);

    var infowindow = new google.maps.InfoWindow({

        content: "<b>{!HTMLENCODE(Location__c.Name)}</b><br>" + locLat + "<br>" + locLong

    });

I am trying to use JSENCODE to get away from stored XSS security flags. When I use it I get an error  "Incorrect argument type for function 'JSENCODE()'"

 

I am not sure what I am getting wront on this. When I don't use JSENCODE the value comes out but when I wrap it in JSENCODE it gives the error when saving in Eclipse.  Below is my code snippet, thanks for the help in advance.

 

function initialize() {

 

    var myOptions = {

        zoom: 8,

        mapTypeId: google.maps.MapTypeId.ROADMAP,

        mapTypeControl: false

    }

    var locLat = {!JSENCODE(Location__c.Latitude__c)};

    var locLong = {!Location__c.Longitude__c};

    var myLatlng = new google.maps.LatLng(locLat, locLong);

    var infowindow = new google.maps.InfoWindow({

        content: "<b>{!HTMLENCODE(Location__c.Name)}</b><br>" + locLat + "<br>" + locLong

    });