Αναζήτηση στην υποστήριξη

Προσοχή στις απάτες! Δεν θα σας ζητήσουμε ποτέ να καλέσετε ή να στείλετε μήνυμα σε κάποιον αριθμό τηλεφώνου ή να μοιραστείτε προσωπικά δεδομένα. Αναφέρετε τυχόν ύποπτη δραστηριότητα μέσω της επιλογής «Αναφορά κατάχρησης».

Learn More

HTML Link (<a href)- wrong behaviour

  • 2 απαντήσεις
  • 3 έχουν αυτό το πρόβλημα
  • 15 προβολές
  • Τελευταία απάντηση από goncalofbg

more options

Hello,

This simple code

<a href="javascript:$('.div-feedback').fadeIn();">

doesn't work in my newest version of firefox 29.0.1. it works on chrome just fine as it should.

rather than interpret as javascript, it reads as an url (opens the page "javascript:$('.div-feedback').fadeIn();" which is wrong of course)

Do you have an idea why?

Thank you Gonçalo

Hello, This simple code <a href="javascript:$('.div-feedback').fadeIn();"> doesn't work in my newest version of firefox 29.0.1. it works on chrome just fine as it should. rather than interpret as javascript, it reads as an url (opens the page "javascript:$('.div-feedback').fadeIn();" which is wrong of course) Do you have an idea why? Thank you Gonçalo

Επιλεγμένη λύση

Actually, the href attribute is supposed to direct the browser to a new URL, etc., not run a script. Instead, use the onclick event attribute:

   <a onclick = “$('.div-feedback').fadeIn();”></a>.

Happy coding!

Ανάγνωση απάντησης σε πλαίσιο 👍 0

Όλες οι απαντήσεις (2)

more options

Επιλεγμένη λύση

Actually, the href attribute is supposed to direct the browser to a new URL, etc., not run a script. Instead, use the onclick event attribute:

   <a onclick = “$('.div-feedback').fadeIn();”></a>.

Happy coding!

Τροποποιήθηκε στις από το χρήστη Epicaleb