I’m trying to make a method call in client, but I get
Exception in template helper: Error: Syntax error, unrecognized expression: https://www.example.com
I’m using a Meteor method to parse a URL in XML to get some data, so my variable is a string URL
Method
rank: function(postAttributes) {
check(postAttributes, {
url: String
});
var alexa = require('alexarank');
var alexaSync = Meteor.wrapAsync(alexa);
var result = alexaSync({url: postAttributes.url});
return result.rank;
}
Client Call
function() {
var a = document.createElement('a');
a.href = this.url;
var post = {
url: $(a.href)
};
Meteor.call('rank', post, function(error, result) {
// display the error to the user and abort
if (error)
return throwError(error.reason);
// show this result but route anyway
return result;
});
}
Any idea?