Be seen. Boost your question’s priority for more expert views and faster solutions
function save_to_db(item)
{
var widget_id;
widget_name = item.attr('id'); //ie - image_widget
alias = widget_name.replace("_widget", "");
$.ajax({
//ajaxsetup ftw
data: {
'action': 'add_element',
'page_id': '106034386126175',
'element_id' : alias
},
success: function(msg)
{
widget_id = msg;
}
});
return widget_id;
}
$.ajax({
//ajaxsetup ftw
async: false,
data: {
'action': 'add_element',
'page_id': '106034386126175',
'element_id' : alias
},
success: function(msg)
{
widget_id = msg;
}
});
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
var widget_id = $.ajax({ url: "some.php", async: false }).responseText;
so :
Open in new window