jquery - Anchor tag with mailto and javascript function -


Below is my part of code, I am trying to perform a JavaScript function and mailout when the user clicks on anchor-link My Javascript function is throwing errors, if I remove the mail then it works fine. If I am missing anything then please give advice.

  & lt; One rel = "nofollow" onclick = "javascript: confirm ('2 r', 'ADDRESS'); return true;" href = "mailto: housing@test.edu? topic = incorrect residential address" & gt; Accommodation @test.edu (click here) & lt; / A & gt;   

Here is my confirmation function, which has an AJAX call

  Confirm the function (adodod, type) {$ .ajax ({url: ' https: // mysite.url / confirm ', data type:' jason ', method:' post ', cache: wrong, first send: function set header (xhr) {console.log (adodod +' & lt; - & gt; '+ type +' & lt mask ("Please wait ...")}}, data: {'addcode': adodoad, 'type': type, '' $ ("# main-content" ). Unmask ();}, Error: Work (Excerpt, TestStatus, Error) {$ ("Console Law C (error); console.log (xhr); console.log (testStatus);}};}    

can not be commented yet: I think this is not a real error, and this code does not work as much as it is expected.

  • You Before activating 'mailto:' you want a confirmation box.
  • If the user presses
  • If the user is not pressed, then you do not want to do anything.

    Here is a crossbowover solution: jsfiddle :

      function mConfirm (e, a) {if (confirm ('do you really want to send it:' + a + '?')) {Back true; } And E.Pravant Default (); }   

    Edit:

    BTW You can not change the title of the confirmation box. The 'confirmation (function)' function works only with 1 argument if you insist on creating a confirmation box with a title, then you should use a third party script or your own function.

Comments

Popular posts from this blog

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -