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 8728637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:41:08+00:00 2026-06-13T08:41:08+00:00

I am beginner to ruby on rails what I want to do in my

  • 0

I am beginner to ruby on rails what I want to do in my application is call java script function from script define inside view file like in following manner

//code inside js file ...
$(document).ready(function() {
    alert("outside the function");
function abc()
{
    alert("inside function");
}
});

//code in side view file 
<div> creating view here </div>
<script type="text/javascript" language="javascript">
    abc();
</script>

But It not giving require output. It shows one alert i.e. outside the function. But not showing other one that mean not calling that function. I want to call that function …
How to do this? Any solution?
Need help … Thank you ….

  • 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-06-13T08:41:10+00:00Added an answer on June 13, 2026 at 8:41 am

    Try this, you need to move your function abc() outside the jQuery ready wrapper function.

    $(document).ready(function() {
        alert("outside the function");
    
    });
    
    function abc(){
        alert("inside function");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Brief question, beginner's work on Ruby/Rails. Here's my view: <h1>News</h1> <%= @posts.each do |post|
I am a beginner in Ruby on Rails and I want to develop an
A few years back, I started learning Ruby/Rails from some beginner's guide for Rails.
I am beginner in ruby + rails. I have problem to get values in
I am a beginner to ruby on rails.But i am quite comfortable with php,
I am a beginner with Ruby and Rails but I managed to use OmniAuth
Please forgive me. I am definitely a beginner at Haml and Ruby on Rails.
I'm a beginner of Ruby and Rails, so this is probably an easy question.
I'm still a beginner with ruby and rails, and now I'm googling about methods
I'm a beginner at Ruby On Rails and am trying to get a migration

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.