Jump to content

Recommended Posts

Im using Jquery's way of loading data into divs and such, it works fine in firefox, but i just noticed it doesnt work in safari.. Why?

 

my code:

 

function save_changes(id)
{
var name = $("#product-name").val();
var price = $("#product-price").val();
var descr = $("#product-descr").val();
var photo = $("#product-photo").val();

$(".saved-changes").empty();
$(".saved-changes").append("<div class='changes-saved'>Saving Changes...</div>");
$.ajax({
type: "POST",
url: "ajaxpages/update_antique.php",
data: "id="+id+"&name="+name+"&price="+price+"&descr="+descr+"&photo="+photo,
cache: false,
success: function(html){
$(".saved-changes").empty();
$(".saved-changes").append("<div class='changes-saved'>Changes Saved!</div>");

$(".product-unsaved").empty();	
}
});	

}

Link to comment
https://forums.phpfreaks.com/topic/217617-jquery-ajax-doesnt-work-in-safari/
Share on other sites

I do, I would have to update the files to my most current files, but, I recently discovered that it's Multiple variables that is causing the problem.

 

html to call function:

 

<div class="announcements-containers" onClick='view_announcement(this);' id='<?php print $id?>'>

 

 

javascript code:

 

function view_announcement(obj)
{
var id = $(obj).attr("id");
var class = $(obj).attr("class");

$("#slideshow").fadeOut("fast");
$(".homeantiqueholder").slideUp("fast");
$('.home-middle-content').animate({height: "490px", marginTop: "-10px"},100);
$('.updatestream, #announcer, .announcements-container').animate({ height: "490px"},100);

if(class!="announcements-containers announcements-current")
{
$(".announcements-containers").removeClass("announcements-current");
}

$("#"+id).addClass("announcements-current");

$("#announcer").empty();
$("#announcer").html("<div class='announcement-loading'>Loading...</div>");
$.ajax({
type: "POST",
url: "ajaxpages/view_announcement.php",
data: "id="+id,
cache: false,
success: function(html){
$(".announcement-close").show();
$("#announcer").html("");
$("#announcer").append(html);

}
});	

}

 

When i delete the if statement inside, and the var class = $(obj).attr("class"); line it works fine in safari, however with both of them it does not. I cannot figure out why, it doesn't make sense.

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.