-2

A Jquery javascript as a part of all inlinescripts in scripts.js A standard boilerplate combination with Modernizr2.0

In chrome 13.0.782.215 on macintosh, ie 7/8 and mozilla 3.6.20 for windows the script works like a charm. ie 9 ican't test.

In Safari and firefox however it doesn't??

Here is the script:

jQuery(document).ready(function(){  
jQuery("a#deletefromcart").click(function(event){
event.preventDefault();
var did = jQuery(this).data('delid');
jQuery.ajax({
type: "GET",
url: "assets/components/cart/deletefromcart.php",
data: "id=" + did
});
jQuery("tr.hide"+did).hide("slow");
location.reload(true);
});

Here wat firebug is reporting in mozilla

404 Not Found

1.23s

jQuery is not defined
anonymous()scripts.js (regel 22)
anonymous()jquery....min.js (regel 17)
anonymous()jquery....min.js (regel 16)
jQuery("tr.hide"+did).hide("slow");
scripts.js (regel 22)


"NetworkError: 404 Not Found - http://secure.hurby.com/cart/assets/components/cart/deletefromcart.php?id=415"

did some experiments with cache=false loading after success but no luck.

I just can't seem to pin point what is wrong, more a artist then a developer so please help me rewrite this script into something cross-browser compatible.

The sun comes up for free so:

A reward will be yours The one fixing this will receive a Ciclee print of choosing of one of the 144 works in my new website. Won't be selling none if i can get it working.

Gr Hurby


Yes the file exsist Juhana. Roselan, i changed the parameter to the value you proposed. still the same behaviour. Chrome, ie and moz win still are working well with the new parameter.

But still safari and moz for mac are refusing to do it.

adding or deleting a painting to/from the cart doesn't require a login, so you can test yourself

gr Hurby

ps. http://secure.hurby.com/schilderijen,-kaarten-en-giclee-prints/werken/braaaf.html

it's all dutch so hopefully it makes some sense just hit "in winkelwagen" button, and you should be redirected to the cart. here you will find the item. Sometimes it needs to be done two times, after that it is working fine. Normally you would register to go to checkout.

Clicking the X (the function that is broken in sfari and ff mac) should delete the item but doesn't in Safari and ff mac.


Okay Tony,

i think you got something*-)

the file path should be: http://secure.hurby.com/assets/components/cart/deletefromcart.php http://secure.hurby.com/cart/assets/components/cart/deletefromcart.php

somehow, ff and safari add: cart/ before.

All files are one the same domain.

Now it's finding why this happens in these two browsers and how to change the code to something working. Really don;t have a clue...

gr HUrby


The right path for Moz on mac (to not get the mentioned 404) =

/assets/components/cart/deletefromcart.php instead of

assets/components/cart/deletefromcart.php

but now firebug in moz mac says the script is wrong:

jQuery is not defined jQuery("tr.hide"+did).hide("slow");

and windows IE stopped working when setting the /in front of the path chrome on mac and moz for windows are still fine.

so with "/" 3 browsers are working. without "/" only two.

here the state of present code:

jQuery(document).ready(function(){  
jQuery("a#deletefromcart").click(function(event){
event.preventDefault();
var did = jQuery(this).data('delid');
jQuery.ajax({
type: "GET",
url: "/assets/components/cart/deletefromcart.php",
data: {id: did}
});
jQuery("tr.hide"+did).hide("slow");
location.reload(true);
});
Timo Tijhof
  • 10,032
  • 6
  • 34
  • 48
Whp Kroon
  • 1
  • 1
  • Does that file exist? I get a 404 when I try to go to that URL. – JJJ Aug 25 '11 at 10:27
  • I'm not sure it's linked, but shouldn't the ajax data param be a json object? in your case: `data: {id: did}` – roselan Aug 25 '11 at 10:41
  • 1
    If you register an account and stop creating new "unregistered" accounts then you'll be able to add updates to your question. Please do this and stop using answers for updates. Thanks. – Kev Aug 25 '11 at 18:58

1 Answers1

0

Is the path correct in the FireBug output? i.e. should 'cart' be included twice?

http://secure.hurby.com/cart/assets/components/cart/deletefromcart.php

Perhaps you need to change the URL to just

/cart/deletefromcart.php

rather than

assets/components/cart/deletefromcart.php

Alternatively, it could be a cross domain problem. Are you trying to call the php page from a website other than secure.hurby.com?

tonycoupland
  • 4,127
  • 1
  • 28
  • 27