I FIX THAT WITH
confirmReset(\''.$nodetitle.', '.$nodeid.'\')
Question :
I want to run a simple JavaScript function on a if user press the button, alert confirm show the ID
and TITLE
of page and Finaly redirect the custom url
my problem is just ID
have passed and Title
not!
Variables
$nodetitle = "Title one";
$nodeid = 150;
HTML
<button class="btn" onclick="return confirmReset('.$nodetitle.', '.$nodeid.');">
JAVASCRIPT
function confirmReset(nodetitle, nodeid) {
var r = confirm('Node with ( ' + nodeid + nodetitle + ' ) Delete?');
var url = window.location.pathname;
var pathArray = url.split( '/' );
var host = pathArray[1];
if (r == true) {
document.location.href = 'node/' + nodeid + '/delete';
} else {
// alert('it didnt work');
}
return false;
}
this code just return numbers like Nodeid
and nodetitle
NOT returned
Thanks for you help my friends...