This is a webservice having script loaded on CheckJs webmethod.
    [WebMethod(EnableSession = true)]
    [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
    public string CheckJs()
    {
        string script = "<script> (function() { alert('script loaded'); })(); </script>";
        return script;
    }
Checkscript.js
Here we call the AJAX method to consume webservice result
function Loadarticlecomments() {
inputdata = {};        
var outputhtml = "";
var newurl = "/WebServices/CheckJsScript/WSScript.asmx/CheckJs";
var dataStrVal = "";
jQuery.ajax({
    type: "POST",
    url: newurl,
    data: dataStrVal,
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function(result) {            
        if (result.d != null && result.d.length > 0) {                
            $(".commentsid").html((result.d));
        }
    },
    error: function(result) {
        console.log('JS Script-  system failure');
        return false;
    }
});
}
script is not firing.Could you please someone fix this?
 
     
    