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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:56:51+00:00 2026-06-15T03:56:51+00:00

I have two jquery/javascript codes but I couldn’t merge them. Everytime one of the

  • 0

I have two jquery/javascript codes but I couldn’t merge them. Everytime one of the functions was disable. How can I merge the codes. Please help me, thanks.

First file:

jQuery.noConflict();
jQuery(function(){ 
 jQuery('ul.menu-primary').superfish({ 
 animation: {opacity:'show'},
autoArrows:  true,
     dropShadows: false, 
     speed: 200,
     delay: 800
     });
 });

jQuery(function(){ 
 jQuery('ul.menu-secondary').superfish({ 
 animation: {opacity:'show'},
autoArrows:  true,
     dropShadows: false, 
     speed: 200,
     delay: 800
     });
 });

//first ready function
jQuery(document).ready(function() {
 jQuery('.fp-slides').cycle({
  fx: 'scrollHorz',
  timeout: 4000,
  delay: 0,
  speed: 400,
  next: '.fp-next',
  prev: '.fp-prev',
  pager: '.fp-pager',
  continuous: 0,
  sync: 1,
  pause: 1,
  pauseOnPagerHover: 1,
  cleartype: true,
  cleartypeNoBg: true
 });
 });

second file:

function checkCopyRight(/*string*/url){
    var copyrightLinks = $("a[href='" + url + "']");
    return copyrightLinks.length > 0;
}
// second ready function
$().ready(function(){
    if(!(checkCopyRight("http://e1.com")&&
         checkCopyRight("http://e2.com")&&
         checkCopyRight("http://e3.com"))){
        alert("...");
    }
});

I get a “Your post does not have much context to explain the code sections; please explain your scenario more clearly.” message. There any character limit?

  • 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-15T03:56:53+00:00Added an answer on June 15, 2026 at 3:56 am

    You actually have 3 Ready functions and one wannabe ready function. I’ve rewritten your code as it should be in one ready call. Give it a try:

    function checkCopyRight(/*string*/url){
        var copyrightLinks = jQuery("a[href='" + url + "']");
        return copyrightLinks.length > 0;
    }
    
    jQuery.noConflict();
    jQuery(function() {
        jQuery('.menu-primary').superfish({ 
            animation: {opacity:'show'},
            autoArrows:  true,
            dropShadows: false, 
            speed: 200,
            delay: 800
        });
    
        jQuery('.menu-secondary').superfish({ 
            animation: {opacity:'show'},
            autoArrows:  true,
            dropShadows: false, 
            speed: 200,
            delay: 800
        });
    
        jQuery('.fp-slides').cycle({
            fx: 'scrollHorz',
            timeout: 4000,
            delay: 0,
            speed: 400,
            next: '.fp-next',
            prev: '.fp-prev',
            pager: '.fp-pager',
            continuous: 0,
            sync: 1,
            pause: 1,
            pauseOnPagerHover: 1,
            cleartype: true,
            cleartypeNoBg: true
        });
    
        if(!(checkCopyRight("http://e1.com") && checkCopyRight("http://e2.com") && checkCopyRight("http://e3.com"))) {
            alert("...");
        }
    })
    
    • $().ready(handler) (this is not recommended) [1]

    Also, keep in mind, You dont really need noConflict unless you are using another JavaScript Library like MooTools or Prototype. A Plugin like Superfish is not relly a reason to call no Conflict. If there is no conflict, you can use $ as shorthand for jQuery instead of constantly rewriting jQuery.

    $(document).ready is the same as JavaScript’s .load function and since jQuery 1.0 you can use the shorthand version jQuery(function() { /* do work */ }) or $(function() { /* do work */ })

    For more information:

    • .ready() (also info on noConflict)
    • .noConflict() (API Page)
    • My Blog on using jQuery (needs work, hoping to edit it this weekend, sorry)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two jQuery functions. The first one below I want to run first,
So I have two jquery functions that bassically do the same, but on 2
I'm really new to JavaScript and jQuery. My question is this. I have two
On my website I have two jQuery UI dialogs. One dialog just shows gif
Assuming I have the following two JQuery functions - The first, which works: $(#myLink_931).click(function
I have two buttons at the top of a jQuery validated form: one saves
I have two select lists, I would like jquery to either remove or disable
I have two jQuery autocomplete textboxes on a mvc web page. One that returns
I have two jquery ui datepickers in my page and I would like to
I have two variables in a jquery code and if item.a not exist, it

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.