I need to send the page title and process the data. But when I perform without the x variable it works fine. But when I pass pass the x variable it will stop working.
window.onload = function() {
if(document.readyState === 'complete') {
var x = document.getElementsByTagName("title")[0];
$.post({
type: "POST",
method: 'POST',
cache: false,
processData: false,
dataType : "text",
url: "http://localhost:8000/search?title=kishore",
data: {title: x},
success: function(data) {
console.log(data);
});
};
}