Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
How to knowing how many people added site to their favourite today?
Old 03-02-2007, 03:33 AM How to knowing how many people added site to their favourite today?
Average Talker

Posts: 16
Trades: 0
Hi all,
I think this question is simple. As I am relatively new in this domain, I could not find an answer. So please share me a code which will enable us to tell how many people have added a page to the favourite?
Regards
__________________
Joseph James

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Joseph James is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-02-2007, 03:39 AM Re: How to knowing how many people added site to their favourite today?
Novice Talker

Posts: 6
Name: Neil Oman
Trades: 0
don't think you can do it, certainly not on every browser
nellos121 is offline
Reply With Quote
View Public Profile
 
Old 03-02-2007, 11:16 AM Re: How to knowing how many people added site to their favourite today?
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
You could use a remote xmlHttpObject call to do that when a user use a link in your site to add the bookmark, but not if he use either a keyboard shortcut ar manually drag the link in his/her favorites list.

If you want to do that, the solution is to add an "onclick='javascript:addCount();'" on the link.

As an onclick is always executed before the href, we can use it to launch a remote AJAX call, record the click, and then call the javascript function to add the bookmark in the href.

There is no universal methode to do that, so I won't give you a confusing exemple here, but basically, the steps required are:
1) Set up a backend PHP/JSP/ASP/wathever dynamic language to record the click. Simply make so that on every access, it increas a counter in a table of your database.
2) Write a javascript function that will do the call. Depending of the framework you use (or not), the syntax will differ a lot, report to the user documentation for that.
3) Set up the "add to favorites" bookmark that way:
Code:
<a href="javascript:addBookmark();" onclick="recordClick();">Add to favorites</a>
In this exemple, recordClick() is the javascript function that will do the ajax call, and addbookmark() will be the one that detect which browser it is and call the right method for each. Yep, nearly every browser have his own syntax to that...
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to How to knowing how many people added site to their favourite today?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11664 seconds with 12 queries