Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Java script & IE 7

Java script & IE 7

Scheduled Pinned Locked Moved ASP.NET
javatoolsquestion
13 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Enobong Adahada

    Please how do i get java script to work on IE 7. the code works fine in Firefox, it the Epoch calendar function that i am using in my project. thanks.

    J Offline
    J Offline
    Jamil Hallal
    wrote on last edited by
    #2

    Hi, your javascript code should works fine on IE7 but there is some compatibility issues that you have to take into your consideration, please post here the code that is not working so we can suggest a solution anyway check this link for more information about javascript compatibility issues http://www.w3schools.com/js/default.asp[^]

    Regards, Jamil

    1 Reply Last reply
    0
    • E Enobong Adahada

      Please how do i get java script to work on IE 7. the code works fine in Firefox, it the Epoch calendar function that i am using in my project. thanks.

      A Offline
      A Offline
      Arindam Tewary
      wrote on last edited by
      #3

      When you have your javascript code working in some browser and not working in other then you need write code to detect browser and then accordingly need to write javascript code. Here is link that help you to write code to detect browser. [http://www.javascriptkit.com/javatutors/navigator.shtml] [http://www.quirksmode.org/js/detect.html]

      Thanks, Arindam D Tewary

      J 1 Reply Last reply
      0
      • A Arindam Tewary

        When you have your javascript code working in some browser and not working in other then you need write code to detect browser and then accordingly need to write javascript code. Here is link that help you to write code to detect browser. [http://www.javascriptkit.com/javatutors/navigator.shtml] [http://www.quirksmode.org/js/detect.html]

        Thanks, Arindam D Tewary

        J Offline
        J Offline
        Jamil Hallal
        wrote on last edited by
        #4

        Hi Arindam, why you need to detect the browser type/version, i think the best practice is to have a javascript code that works(compatible) with all type of browsers .

        Regards, Jamil

        A 1 Reply Last reply
        0
        • J Jamil Hallal

          Hi Arindam, why you need to detect the browser type/version, i think the best practice is to have a javascript code that works(compatible) with all type of browsers .

          Regards, Jamil

          A Offline
          A Offline
          Arindam Tewary
          wrote on last edited by
          #5

          Hi Jamil, Yes, you are correct, the best practice is that one should write a code which is independednt of type of browser. Unfortunately not all javascript is supported by all browser's javascript processing engine. Thats why we need to detect browser type and write code. As in the problem statement says that the person is having a piece of code which is wokring in Mozila and not in IE 7.0, that prompted me to suggest the same. But rule of thumb is definitely as you have mentioned. :)

          Thanks, Arindam D Tewary

          J B 2 Replies Last reply
          0
          • A Arindam Tewary

            Hi Jamil, Yes, you are correct, the best practice is that one should write a code which is independednt of type of browser. Unfortunately not all javascript is supported by all browser's javascript processing engine. Thats why we need to detect browser type and write code. As in the problem statement says that the person is having a piece of code which is wokring in Mozila and not in IE 7.0, that prompted me to suggest the same. But rule of thumb is definitely as you have mentioned. :)

            Thanks, Arindam D Tewary

            J Offline
            J Offline
            Jamil Hallal
            wrote on last edited by
            #6

            oh, i see i got your idea. but from my point of view i would prefer to write a code that is compatible with the main browsers (Firefox, IE and Chrome) :)

            Regards, Jamil

            1 Reply Last reply
            0
            • A Arindam Tewary

              Hi Jamil, Yes, you are correct, the best practice is that one should write a code which is independednt of type of browser. Unfortunately not all javascript is supported by all browser's javascript processing engine. Thats why we need to detect browser type and write code. As in the problem statement says that the person is having a piece of code which is wokring in Mozila and not in IE 7.0, that prompted me to suggest the same. But rule of thumb is definitely as you have mentioned. :)

              Thanks, Arindam D Tewary

              B Offline
              B Offline
              Brij
              wrote on last edited by
              #7

              I agree to you Arindam. There are a lot javascript code that does not run smoothly on all main browsers. So sometime we have to go for detecting the browser and take the steps accordingly. Everytime we can not get all js code that run all the browser, might be one has to pick another approach or rely very less on javascript, and use server side code as much as possible but this is not good for performance point of view. Hope the coming new browser follow the same standards and create less pain for us :)

              Cheers!! Brij Check my latest Article :Exploring ASP.NET Validators

              A 1 Reply Last reply
              0
              • B Brij

                I agree to you Arindam. There are a lot javascript code that does not run smoothly on all main browsers. So sometime we have to go for detecting the browser and take the steps accordingly. Everytime we can not get all js code that run all the browser, might be one has to pick another approach or rely very less on javascript, and use server side code as much as possible but this is not good for performance point of view. Hope the coming new browser follow the same standards and create less pain for us :)

                Cheers!! Brij Check my latest Article :Exploring ASP.NET Validators

                A Offline
                A Offline
                Arindam Tewary
                wrote on last edited by
                #8

                Thanks Brij. Nice to have your comment here. :)

                Thanks, Arindam D Tewary

                B 1 Reply Last reply
                0
                • A Arindam Tewary

                  Thanks Brij. Nice to have your comment here. :)

                  Thanks, Arindam D Tewary

                  B Offline
                  B Offline
                  Brij
                  wrote on last edited by
                  #9

                  Your welcome :)

                  Cheers!! Brij Check my latest Article :Exploring ASP.NET Validators

                  1 Reply Last reply
                  0
                  • E Enobong Adahada

                    Please how do i get java script to work on IE 7. the code works fine in Firefox, it the Epoch calendar function that i am using in my project. thanks.

                    E Offline
                    E Offline
                    Enobong Adahada
                    wrote on last edited by
                    #10

                    this is the segment of code; var popup1; window.onload = function() { popup1 = new Epoch('popup1','popup',document.getElementById('txtdateofbirth'),false); }; thanks again.

                    J 1 Reply Last reply
                    0
                    • E Enobong Adahada

                      this is the segment of code; var popup1; window.onload = function() { popup1 = new Epoch('popup1','popup',document.getElementById('txtdateofbirth'),false); }; thanks again.

                      J Offline
                      J Offline
                      Jamil Hallal
                      wrote on last edited by
                      #11

                      Hi, i see that you are using the Epoch Popup calendar, it is really nice :) which section of the code is not working? because this Popup is compatible with the main browsers . by the way why are you using onfocus="popup1.setTarget(this)"?

                      Regards, Jamil

                      J 1 Reply Last reply
                      0
                      • J Jamil Hallal

                        Hi, i see that you are using the Epoch Popup calendar, it is really nice :) which section of the code is not working? because this Popup is compatible with the main browsers . by the way why are you using onfocus="popup1.setTarget(this)"?

                        Regards, Jamil

                        J Offline
                        J Offline
                        Jamil Hallal
                        wrote on last edited by
                        #12

                        oh i got the reason: It lets you assign a single instance of Epoch to an unlimited number of <INPUT> boxes—all you need to do is add an onFocus() event handler to the box. This saves both memory and reduces your page's load time.

                        Regards, Jamil

                        E 1 Reply Last reply
                        0
                        • J Jamil Hallal

                          oh i got the reason: It lets you assign a single instance of Epoch to an unlimited number of <INPUT> boxes—all you need to do is add an onFocus() event handler to the box. This saves both memory and reduces your page's load time.

                          Regards, Jamil

                          E Offline
                          E Offline
                          Enobong Adahada
                          wrote on last edited by
                          #13

                          pls how do i get it to work with IE 7. this is the .js class code: function Epoch(name,mode,targetelement,multiselect) { this.state = 0; this.name = name; this.curDate = new Date(); this.mode = mode; this.selectMultiple = (multiselect == true); //'false' is not true or not set at all //the various calendar variables //this.selectedDate = this.curDate; this.selectedDates = new Array(); this.calendar; this.calHeading; this.calCells; this.rows; this.cols; this.cells = new Array(); //The controls this.monthSelect; this.yearSelect; //standard initializations this.mousein = false; this.calConfig(); this.setDays(); this.displayYear = this.displayYearInitial; this.displayMonth = this.displayMonthInitial; this.createCalendar(); //create the calendar DOM element and its children, and their related objects if(this.mode == 'popup' && targetelement && targetelement.type == 'text') //if the target element has been set to be an input text box { this.tgt = targetelement; this.calendar.style.position = 'absolute'; this.topOffset = this.tgt.offsetHeight; // the vertical distance (in pixels) to display the calendar from the Top of its input element this.leftOffset = 0; // the horizontal distance (in pixels) to display the calendar from the Left of its input element this.calendar.style.top = this.getTop(targetelement) + this.topOffset + 'px'; this.calendar.style.left = this.getLeft(targetelement) + this.leftOffset + 'px'; document.body.appendChild(this.calendar); this.tgt.calendar = this; this.tgt.onfocus = function () {this.calendar.show();}; //the calendar will popup when the input element is focused this.tgt.onblur = function () {if(!this.calendar.mousein){this.calendar.hide();}}; //the calendar will popup when the input element is focused } else { this.container = targetelement; this.container.appendChild(this.calendar); } this.state = 2; //0: initializing, 1: redrawing, 2: finished! this.visible ? this.show() : this.hide(); } //----------------------------------------------------------------------------- Epoch.prototype.calConfig = function () //PRIVATE: initialize calendar variables { //this.mode = 'flat'; //can be 'flat' or 'popup' this.displayYearInitial = this.curDate.getFullYear(); //the initial year to display on load this.displayMonthInitial = this.curDate.getMonth(); //the initial month to display on

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups