Find a div in Callback string
Hi folks,
I'm starting with jQuery (and I'm not very familiar with Javascript). It's probably an easy question but strangely enough I couldn't find anything that could help me solving my problem :
I have to get the status of a server via SSI command (<!--#echo var="myVar" -->). In my callback, I can display the whole webpage without problem. I can also see the
relayDisplay div filled with my answer. Great!
But I want to extract it from that string. Tried with
find and other functions, selectors... but I just can get
undefined or
Object not defined or
null or
[blank] or ...
- $(document).ready(function(){
function changeStatus(string)
{
//alert( string ) ;
alert( $(string).find("#relayDisplay").html() ) ;
}
$("button").click(function(){$.get("http://192.168.254.254/index.html?cmd=myCmd", function(result){ changeStatus(result) ; }, "html" );
});
});
</script>
<title>Test</title>
</head>
<body>
<div id="relayDisplay"><!--#echo var="myVar" --></div>
<button>Change Content</button>
</body>
</html>
Thank you in advance for your help!