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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:54:31+00:00 2026-06-12T19:54:31+00:00

I have 2 js files. Although both do the same thing one does not

  • 0

I have 2 js files. Although both do the same thing one does not work on IE 7, as such I have 2 different JS files. I need one to be called if the browser is IE7 and the other to be called in all other situations.

I have the standard Yii declaration at the top of the page.

<?php
    Yii::app()->getClientScript()->registerScriptFile(Yii::app()->baseUrl . '/js/jquery-1.4.4.js');
    //etc....
?>

I have tried the following in the document.ready function.

var browserIE7 = (navigator.userAgent.indexOf("MSIE 7")>=0) ? true : false;
if(browserIE7){
    Yii::app()->getClientScript()->registerScriptFile(Yii::app()->baseUrl . '/js/IEjquery-1.4.4.js');
}else{
    Yii::app()->getClientScript()->registerScriptFile(Yii::app()->baseUrl . '/js/jquery-1.4.4.js');
}

However that does not work. I have never needed to do this before and as such am having difficulty figuring out how to do it.

Any help is appreciated.

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-12T19:54:32+00:00Added an answer on June 12, 2026 at 7:54 pm

    If you would like for some js hack you can use in your html as follows to include your script for IE only version

    <!--[if lt IE 7]>
    <script src="http://example.com/js/IEjquery-1.4.4.js"></script>
    <![endif]-->
    

    Refer http://code.google.com/p/ie7-js/

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

Sidebar

Related Questions

I have files a1 a2 a3 b1 b2 b3 and I need to exclude
Let's assume that I have files a.cpp b.cpp and file c.h. Both of the
I have two different classes that share a common interface. Although the functionality is
Can a cgi-bin perl script from one WAR access files in another WAR, such
I have files with texts an constants. How can I get constant name and
I have files served like so: AJAX request handler -> Include file I would
I have files which have many empty cells which appear as NaNs when I
I have files on the server. Originally their names are readable and users put
In my Visual Studio 2010 project I have files with .mm file extension, that
Let's say I have Directory 1 and Directory 2, and each can have files

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.