• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Why is jquery failing to grab the href of a clicked url?

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is how best i can describe what i'm facing now:

  • I have a js code in the head section of my webpage to grab the href of any clicked link  from the page


  • Send the href through ajax to a server side servlet which is saddled with the job of updating the number of times the said url have been clicked in the database.


  • this is how my href looks like


    here's the jquery to grab it


    my servlet code in brief.


  • After sending, open the said link in a new browser window and progress.



  • In my browser Network console,  my POST request to clickCountServlet shows a 200(oK).

    but when i try to print the value of the data sent from js code i discover its null.

    why?
    i'm suspecting the jquery code, it is why i decide to post this here.

    thisss.PNG
    [Thumbnail for thisss.PNG]
    this is what my browser network consle shows
    this2.PNG
    [Thumbnail for this2.PNG]
    netbean console
     
    Victor Ade
    Ranch Hand
    Posts: 47
    • Likes 1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Bear Bibeault wrote:As you've got JSF markup in there, this has been moved to the JSF forum.


    Bear Bibeault wrote:As you've got JSF markup in there, this has been moved to the JSF forum.


    Totally understood.  solved the issue a long time ago too. tis  me not specifying a name for the data [and enclosing it in a {}] to be carried to the server. Jquery doc help. Should have gone their first. I'll be careful next time.
    Thanks.
     
    reply
      Bookmark Topic Watch Topic
    • New Topic