Hey guys I am using chrome and developed a window opener using the JQuery UI and it works perfect. In IE and Firefox I notice it wont work and I did the debugging in IE and it said
`SCRIPT1028: Expected identifier, string or number`
function sendUserfNotes()
{
$.ajax({
type: "POST",
dataType: "json",
url: '/pcg/popups/getNotes.php',
data:
{
'nameNotes': notes_name.text(),
},<!-- gave me the error right here?
success: function(response) {
$('#notes_msg').text(response.the_notes);
}
});
No idea why but here is my scripts:
$(document).ready(function () { // this right here will wait to see if the 'access notes is clicked, if so then it will get te value of username and send it to run()
$(".NotesAccessor").click(function () {
notes_name = $(this).parent().parent().find(".user_table");
run();
});
});
function run(){ // defines the place to get the notes, goes to showURL...() to open the JQuery dialog and than senduse....() to display them in the dialog.
var url = '/pcg/popups/grabnotes.php';
showUrlInDialog(url);
sendUserfNotes();
}
function showUrlInDialog(url)
{
var tag = $("#dialog-container");
$.ajax({
url: url,
success: function(data) {
tag.html(data).dialog
({
width: '100%',
modal: true
}).dialog('open');
}
});
}
function sendUserfNotes()
{
$.ajax({
type: "POST",
dataType: "json",
url: '/pcg/popups/getNotes.php',
data:
{
'nameNotes': notes_name.text(),
},
success: function(response) {
$('#notes_msg').text(response.the_notes);
}
});
}
function getNewnotes(){
new_notes = $('#notes_msg').val();
update(new_notes);
}
// if user updates notes
function update(new_notes)
{
$.ajax({
type: "POST",
//dataType: "json",
url: '/pcg/popups/updateNotes.php',
data:
{
'nameNotes': notes_name.text(),
'newNotes': new_notes,
},
success: function(response) {
alert("Notes Updated.");
var i;
$("#dialog-container").effect( 'fade', 500 );
i = setInterval(function(){
$("#dialog-container").dialog( 'close' );
clearInterval(i);
}, 500);
}
});
}
/******is user closes notes ******/
function closeNotes()
{
var i;
$("#dialog-container").effect( 'fade', 500 );
i = setInterval(function(){
$("#dialog-container").dialog( 'close' );
clearInterval(i);
}, 500);
}
If you could give me a hand I would appreciate it :) Not to sure whats wrong and why it will only work in Chrome? Let me know if you need anything.
David
data: { 'nameNotes': notes_name.text(), },
It's a weird issue but remove comma after text()
. That should helps.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.