Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 214713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:24:03+00:00 2026-05-11T18:24:03+00:00

My site provides a javascript that shows the rate of the Dutch equivalent of

  • 0

My site provides a javascript that shows the rate of the Dutch equivalent of the Dow Jones index. Users can embed this script in their website.

It looks like this:

<script type="text/javascript" src="http://www.aexscript.nl/r/gratis"></script>

The corresponding controller action looks like this:

def show
  @script = Script.find_by_code(params[:code])
  @rate = Rate.find(:first)

  respond_to do |format|
    format.js # show.js.erb
  end
end

I want to log the URL of the site the javascript has been embedded on. How can I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T18:24:03+00:00Added an answer on May 11, 2026 at 6:24 pm

    Make a database table that logs your hits. Whenever someone hits show, log it.

    You can rip my code for something similar from http://github.com/saizai/hyperdictionary – take the four_oh_four controller, model, & migration.

    If you have other information (eg you know the logged on user somehow? you know whose link it is?) you can easily add it to that table as a foreign key. Then you’d do something like

    user.js_hits.find(:all, :select => "name, count(id) as count", :group => 'name')
    

    And drop it in a simple view (see my app/views/four_oh_fours/index.html.erb for a simple example).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a site that provides blog-friendly widgets via JavaScript. These work fine in
it appears that the Apple site now only provides download for Xcode 3.2, that
I've seen a lot of users on this site provide operating system specs when
This is the code snippet that the developer site has provided for getting a
I found this site that allows to convert RSS feeds into json. It also
Here's the deal: I am working on a site that provides information for art
We've been discussing about a client-only solution in javascript that provides means for a
For a site that wants the realtime reactivity that Meteor provides on the frontend
Scenario: We provide a hosted site that clients pay to use internally (a tool
I've been trying every tip provided on this site, but none worked, so I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.