Q: jquery $.post function not working in safari I have a javascript/jquery function I call as a link with an added attribute = symbol. It works perfect in Chrome, and it also gets the symbol attribute over to the alert message in the function - but does not execute in Safari.
The link calling the function looks like this
<a onclick=\"addStock(event);\" Symbol=$symbol>Add</a>

The javascript/jquery looks like this
     
    
    function addStock(event) {
        var element = event.target;
        var symbol = element.getAttribute("symbol");

        if (confirm("Add Symbol to Watchlist " + symbol + "?")) {
            $.post("watchlistinsert.php?symbol="+ symbol +"&price=25&watchlistgroupid=1");
            document.location.reload();
            console.log("item " + symbol + " added");
        } else {

            console.log("user canceled");
        }
        return;
    }

Any ideas what is wrong with the code/safari and how to get around it?

A: I guess the first error might be from custom attribute:
Try changing the attribute to this one: Symbol='$symbol'
Secondly have you tried adding a fake href attribute for example href="#" ?
What about debugging js code  ? Did you get any error in safari ?
I think different browser do behave differently when using document or window so I would recommend using the options below and see if any of them work:


*

*window.location.reload(true); 

*location.reload(true);

*window.location.reload()
If none of them work try to use this function here
