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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:27:17+00:00 2026-06-12T17:27:17+00:00

How to use jquery/javascript in yii?, How to use my Script in yii? Why

  • 0

How to use jquery/javascript in yii?,

How to use my Script in yii?

Why is this any different from using jQuery in any other way?

  • 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-12T17:27:18+00:00Added an answer on June 12, 2026 at 5:27 pm

    How to use jquery in yii?

    As you stated above you can either register a new script block or you can register a new external script file. You cna also register assets within plugins which will take entire JS folders and combine them into your app.

    So there are many ways to use JQuery in Yii.

    How to use my jquery in yii

    JQuery comes pre-bundled and activated with JQuery and the JQuery library itself is considered a core script so there is no real need to put your own JQuery in.

    You can overwrite the built in JQuery with your own by putting:

    $cs = Yii::app()->clientScript;
    $cs->scriptMap = array(
    'jquery.js' => Yii::app()->request->baseUrl.'/js/jquery.js',
    'jquery.yii.js' => Yii::app()->request->baseUrl.'/js/jquery.min.js',
    );
    $cs->registerCoreScript('jquery');
    $cs->registerCoreScript('jquery.ui');
    

    Something like that somewhere within either your layout, action or view. I prefer to put this within the layout and manage my own JQuery version personally.

    Why is this any different from using jQuery in any other way?

    Mainly due to standardisation and interoperability of the framework and its components. Coming pre-bundled with built in hooks for JQuery UI widgets and JQuery elements in general makes the framework much easier to build reusable and clean JS objects for use in your app.

    Also I like JQuery so it makes sense for it to come pre-bundled in my opinion. However this is not a call to arms for JQuery being the only JS library/framework out there and you should really consider which is best for you before you choose.

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

Sidebar

Related Questions

Is there any way that I can use JavaScript (and jQuery) to create a
How to use Jquery and Javascript to extract JSON from $ajax and then do
I was creating a countdown timer using javascript; I can use jQuery. I want
How can I use JavaScript/jQuery to populate a popup-window with data from JS-variables in
I'm not getting the same result when I use JQuery vs javascript functions. This
Looking at this layout, I want to use jQuery/Javascript to put the Red Box,
I want to know if there's a way I can use jQuery or javascript
I want to use javascript / jquery to determine if an xml file exists.
How do I use javascript/jquery to change the text on a button in Twitter
Assume you have a page in ASP.NET where it makes sense to use JavaScript/jQuery

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.