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

  • Home
  • SEARCH
  • 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 7494161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:21:18+00:00 2026-05-29T17:21:18+00:00

In greasemonkey for chrome I’m using a function addJQuery(callback) that load jQuery and execute

  • 0

In greasemonkey for chrome I’m using a function addJQuery(callback) that load jQuery and execute the callback function. So I call addJQuery(main). Inside main() i have a function colorizeMe() that i must call every 5 seconds.

function main() {
        //change something using jQuery
        $("#myid").css("width", "10%");

    function colorizeMe(){
        //colorize something using jQuery
                $("#myid").css("color", "red");
    }
    setInterval("colorizeMe()", 5000);
}
addJQuery(main);

This doesn’t work and i have the error
Uncaught ReferenceError: colorizeMe is not defined

where and how i have to define the function colorizeMe() ? If i put colorizeMe() out of main i can use jQuery inside…

  • 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-29T17:21:19+00:00Added an answer on May 29, 2026 at 5:21 pm

    Try this:

    setInterval(colorizeMe, 5000);
    

    Then the main of your user script should be:

    function main() {
        //change something using jQuery
        $("#myid").css("width", "10%");
    
        function colorizeMe(){
            //colorize something using jQuery
            $("#myid").css("color", "red");
        }
        setInterval(colorizeMe, 5000);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Do you have any link\example of Greasemonkey script with Jquery that works in Google
I have created a Greasemonkey script that runs fine in the firebug editor, with
I am writing a greasemonkey script. The site is using jquery, i need a
I have problem with accessing Facebook graph. I am using a Greasemonkey script. When
I want to write a greasemonkey script/chrome user script that takes any images with
I have a user script (for chrome and FF) that adds significant functionality to
I have a simple greasemonkey script that makes some simple dom manipulation. The greasemonkey
I'm interested in writing some Chrome compatible Greasemonkey scripts, but I'm finding that there
Greasemonkey is a great addon but its main drawback is that its not possible
I have a Greasemonkey script which uses jQuery and detects if a class is

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.