Javascript cookies only work in FF

I've written this code to set the font sizes in a joomla site and store them in a cookie, problem is it only works in FF, i've tried several different solutions and I just can't to get it right. This is the code:
function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    return null;
function getFontSize(){
    var size = readCookie("fontsize");
    if (size== null) return "normal"; else return size;
(function($) {
function setFontSize (size)
    if (size == "small")
        $("#contentWrapper").css("font-size", "10px");
        $("#contentWrapper h1").css("font-size","14px");
        $("#contentWrapper h2").css("font-size", "12px");
    if (size == "big")
        $("#contentWrapper").css("font-size","14px");
        $("#contentWrapper h2").css("font-size","16px");
        $("#contentWrapper h1").css("font-size","18px");
    if (size =="normal")
        $("#contentWrapper").css("font-size","12px");
        $("#contentWrapper h2").css("font-size","14px");
        $("#contentWrapper h1").css("font-size","16px");
    document.cookie="fontsize=" + size + ";max-age=" + (60*60*24*365) ;
    $(document).ready(function(){
        var size = getFontSize();
        setFontSize (size);
    $('a#smallFont').click(function(e){
        e.preventDefault();
        setFontSize('small');
        return false;
    $('a#normalFont').click(function(e){
        e.preventDefault();
        setFontSize('normal');
        return false;
    $('a#bigFont').click(function(e){
        e.preventDefault();
        setFontSize('big');
        return false;
    }); // document ready
})(jQuery)
Does somebody know what's going wrong here in the other browsers beside FF?

Have you looked for other  scripts with similiar functionality from http://jquery.com/
where the credit is only needed in the js file itself.  I too, wouldn't be comfortable linking to another site just to use a script - what happens if their site goes down or they close shop - you're then left with an element on your page that doesn't work.....

Similar Messages

  • HT1677 In safari browser cookies is working fine. But when I add the browser url to the screen then the cookies concept is not working. In safari setting cookies is always open only. Can you please provide any information regarding to this?

    In safari browser cookies is working fine. But when I add the browser url to the screen then the cookies concept is not working. In safari setting cookies is always open only. Can you please provide any information regarding to this?

    Hello,
    '''Try Firefox Safe Mode''' to see if the problem goes away. [[Troubleshoot Firefox issues using Safe Mode|Firefox Safe Mode]] is a troubleshooting mode that turns off some settings and disables most add-ons (extensions and themes).
    ''(If you're using an added theme, switch to the Default theme.)''
    If Firefox is open, you can restart in Firefox Safe Mode from the Help menu by clicking on the '''Restart with Add-ons Disabled...''' menu item:<br>
    [[Image:FirefoxSafeMode|width=520]]<br><br>
    If Firefox is not running, you can start Firefox in Safe Mode as follows:
    * On Windows: Hold the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac: Hold the '''option''' key while starting Firefox.
    * On Linux: Quit Firefox, go to your Terminal and run ''firefox -safe-mode'' <br>(you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]] article to find the cause.
    ''To exit Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    When you figure out what's causing your issues, please let us know. It might help others with the same problem.
    Thank you.

  • Javascript only works for "easy" numbers (and multiplying error)

    HIi Everyone,
    I have a scripting problem.  I used javascript to do some division and subtraction, but it only works some of the time in the second half of my form.  What I mean is, if I'm using a nice even number like 100-the calculations are correct, but if I use 415.75, it calculates, but not correctly.  (I actually also have that problem with some multiplying also???)  It's very weird.  And it only seems to be this particular form.
    I can e-mail the form if that will help.  I'd appreciated any help you can give me.
    Thanks,
    Valerie

    Sure.  The form looks like this: (Field Names are in quotes.)
    1. Total Amount of Third Party Recovery      "total third"
    2. Accrued Compensation Lien                   "accrued"   (I clicked in calculations and just clicked "value is the sum of the following: and then clicked the field
         a. "indemnity benefits"                                             names of a and b.)
         b. "expenses of medical"
    3. Expenses of Recovery                             "recovery expenses"
    4. Balance of Recovery                              "balance"  (Its supposed to be #1minus #2)  I used this script:
                                                                     this.getField("balance").value = thisgetField("totalthird").value - this.getField("accrued").value;
    HiddenLockedField "percent" (The content is set to 100.)
    5. Lien Expenses Reimbursement Rate          "5"   (#2 divided by #1 * 100)   I used this script:
                                                                       event.value = ""
                                                                       var accrued = getField("accrued").value;
                                                                       var totalthird = getField("totalthird").value;
                                                                       var percent = getField("percent").value;
                                                                       if(totalthird!null && total third!=0)
                                                                       {event.value = accrued / totalthird * percent;}
    6. Expenses Attributable to Lien                    "attribute"    (Supposed to be #3 times #5.)  I went to calculations, anc clicked on, "value is the product
                                                                         of the following" and checked "recovery expenses" and "5".
    7. Net Lien                                                   "netlien"   (Supposed to be #2-#6) I used this script:
                                                                       this.getField("netlien").value = this.getField("accrued").value - this.getField("attribute").value;
    8. Reimbursement Rate of Future Lia.             "rate" (Supposed to be #3 divided by #1 * 100.) I used this script:
                                                                         event.value = "";
                                                                         var recoveryexpenses = getField("recoveryexpenses").value;
                                                                         var totalthird = getField("totalthird").value;
                                                                         var percent = getField("percent").value;
                                                                         if (totalthird!=null && totalthird!=0)   
                                                                         {event.value = (recoveryexpenses / totalthird) * perent;}           

  • Adobe Flash & Javascript don't work even though Enabled

    Ever since what I think was either a Firefox upgrade (I don't know which one) or installation of Quicktime, my Adobe Flash Plugin is perpetually crashed and I cannot play any Flash content on any website. All that displays in place of the video is a gray screen with the sad-face Lego icon and the message: “The Adobe Flash Plugin has crashed. Please reload the page to try again.” (See attached image.) But it will not resolve when reloaded.
    No Flash videos on any sites work. HTML5 videos work on YouTube when tested, but non-HTML5 videos won't work.
    Also, my Javascript does not seem to be working since at least some displays requiring javascript don't work. Sometimes the display just doesn't work, and sometimes I get a message that javascript is disabled and must be enabled, but it is already enabled (set to “true” in about:config).
    I have spent days scouring every help forum entry I can find on troubleshooting Flash Player and Javascript. Everything on my end seems to be in order and I cannot find or fix either problem. I think it is possible the issue could have its roots in the fact that Javascript seems to not be working which may be preventing Flash Player content from working...??
    Also, Flash content does work in I.E. but not in Firefox (I do not have Chrome installed so did not test in Chrome). I have too many window tabs open in Firefox and can't switch to I.E. (nor do I like to use I.E.).
    PLEASE HELP as this is crippling for very important work deadlines I have.
    This is what else I know and have tried:
    I have a Toshiba Satellite C75D-A Laptop;
    Processor: AMD A6-5200 APU with Radeon HD Graphics; x64; 2.00 Ghz;
    RAM: 8 MB;
    OS: 64-bit system; Windows 8.1 (but some auto-check utilities detect it as 8.0 because it was upgraded.);
    Graphics Card: “Desktop Graphics” System – AMD Radeon HD 8400 (0x9830);
    Installed Graphics Driver Version: AMD 13.352.1004.1007 (Driver Date: 4/22/2014)
    My Device Manager graphics driver updater states: “driver software is up to date.”
    From the AMD website: the graphics driver auto-detect utility recommended the AMD Catalyst Driver (amd-catalyst-omega-14.12-without-dotnet45-win8.1-64bit.exe) I tried installing this driver, but it won't install. After trying to install, I got a message stating: “We are unable to find a driver for your system.” But Device Manager states I have a current driver, and my graphics card & driver seem to be working fine, so I do not believe this is part of the issue.
    I am using Latest Firefox version 35.0.1; and
    Using Latest Flash Player: 32-bit NPAPI Plug-in Version: 16.0.0.296; designated: “always activate” (Downloaded new update several times, including fresh install after uninstall; system & web address icons indicate Flash is enabled).
    I turned off hardware acceleration in FF Tools>Options>Advanced>General
    I disabled WebGL as explained here: https://support.mozilla.org/en-US/kb/upgrade-graphics-drivers-use-hardware-acceleration
    I am using Ad-Block Plus which has never affected things in the past. I have not tried starting FF in Safe Mode because I believe I will lose all open tabs and not be able to recover them (I may have over 200 open). But disabling add-ons has no effect (I disabled all except for Sessions Manager in case of a crash). (My No-Script has been disabled for at least six months.)
    I have Windows Media Player and Quicktime installed.
    Quicktime is most recent upgrade (7.7.6) so should not be a problem according to:
    “QuickTime plugin takes over Flash” at:
    http://kb.mozillazine.org/Flash#Disabling_Protected_Mode_in_Flash_11.3
    (note underscores in place of spaces in string; underscores not insertable here)
    Disabling Quicktime had no effect in the prior version of FF (ver. 35.0), but in latest FF ver. 35.0.1, Flash videos only display a plain (blank) gray screen instead of the sad-faced icon and crash message.
    (I tried to uninstall Quicktime altogether, but was not able to due to Error codes 2502 & 2503. I tried troubleshooting that as well with no luck using methods successful for other programs, including here:
    http://www.fixkb.com/2014/01/error-2503-and-2502-when-uninstalling-on-windows-8.html;
    & here:
    http://answers.microsoft.com/en-us/windows/forum/windows_8-winapps/re-internal-error-codes-2502-and-2503-for/ba5f2145-aa6e-4cc0-81a7-e4346f43b698.)
    Disabling my FF theme and using the default brought back the sad-faced icon and crash message in the place of videos on some YouTube pages, but not other YouTube pages (where video was still blank gray screen). It also enabled a still Flash image (an ad) to display on a different website page that previously had a Flash Plugin crash message. I have been using this same theme for a couple of years without previous issue. While turning it off did generate an effect on some still imagery, it didn't fix the video problem.
    I tried Disabling Protected Mode in Flash 11.3 as explained here:
    http://kb.mozillazine.org/Flash#Disabling_Protected_Mode_in_Flash_11.3
    (note underscores in place of spaces in string; underscores not insertable here).
    It did not solve the issue.
    I also deleted all storage & data in Flash Player as advised. This had no effect either.
    I've tried all solutions I've been able to find and am at a loss for what to try next. Please help and advise ASAP. Thank you!!

    ''guigs2 [[#answer-684038|said]]''
    <blockquote>
    I truely admire the efforts that have been made to make this work.
    "“We are unable to find a driver for your system.” "
    For it not installing, you need to follow these instructions to install them: see the comments: [http://answers.microsoft.com/en-us/insider/forum/insider_wintp-insider_devices/windows-10-atiamd-display-drivers/50944d10-dde3-4e08-8244-d54eb2b1e7de] --> take warning though it looks like it has caused issues for others as well.
    Since it was working for some youtube videos and not others, there might be an issue with a particular video codec. DO you have OpenH264 Video Codec provided by Cisco Systems, Inc. plugin?
    Is it possible to try Safe Mode after saving your session with [https://addons.mozilla.org/en-US/firefox/addon/session-manager/ Session Manager Addon]? IT would test hardware acceleration in Firefox.
    </blockquote>
    Thank you, guigs2! Sorry for my delayed reply...I didn't realize I hadn't gotten back to you. Update is that I did try a whole slew of other troubleshooting steps including starting FF in safe mode, to no avail. However, I was FINALLY (after months) able to solve this problem just today by pure chance!
    The problem was that hardware acceleration was enabled in the Flash settings. I had not been able to turn it off because I didn't have access to the Flash Player settings as long as the crash error message was visible, which was all the time! Today, by a sheer fluke, I saw a static picture in place of the crash message on a Flash video. I snagged the opportunity to call up the settings and turn off hardware acceleration, and it fixed the problem for my whole browser! This has been a frustrating issue because I did not have access to the settings utility as long as I had the crash message, which was always, so my Flash was crippled without the ability for me to fix it until pure luck gave me this window of opportunity.
    Does anyone know another way to access the settings utility if this ever happens again in the future? I could not find a way. (Incidentally, I had tried disabling hardware acceleration via my graphics driver settings, but it didn't fix the problem.) We need Adobe to allow some other way to access the Flash Player settings utility when this problem arises since they aren't accessible when there is a static crash message.
    Thanks again!

  • Hide "more" button in a list view, only works for first item in the list

    I have the following code in a list view that outputs several dozen items in a web app.  The code only works for the first item, how can I make it loop through and execute the test for each item in the list view?  The {tag_hide more button} is a checkmark field that yields a numeric 1" if checked otherwise yields a numeric "0".
    <div id="more-option">
            <p class="right"><a href="{tag_itemurl_nolink}" class="btn btn-small btn-very-subtle">More &rarr;</a></p>
          </div>
          <div class="more-selection" style="display: none;">{tag_hide more button}</div>
          <script>
    if ($(".more-selection").text() == "1") {
        $("#more-option").hide();
    </script>

    What's the URL for the site where you are using this?  Offhand, it looks like it should work with your first example so you are either placing the script before those elements are loaded or you might try wrapping your current javascript inside the:
    $(document).ready(function() {
    --- your existing javascript here
    This make sure the code runs once all the html is loaded on the page.  Without seeing a URL and debugging with the js console in Chrome I can't give you a solid answer.
    But, I do know that you can probably do this with a lot less markup.  Once we figure out what the actual problem is I have a better solution mocked up for you on jsfiddle.
    When looking at my HTML code on jsfiddle, please realize I setup some dummy HTML and removed your tags and added actual values which would be output by your tags.  The main thing I did was remove the whole div.more-selection and instead, added a "data-is-selected" attribute on your div.more-option element.  Then, in my javascript for each div.my-option element on the page, we loop through them, find the value of that data attribute and hide that div if it's less than 1 (or 0).
    Here's the fiddle for you to look at:  http://jsfiddle.net/thetrickster/Mfmdu/
    You'll see in the end result that only two divs show up, both of those divs have data-is-selected="1".
    You can try pasting the javascript code near the closing </body> tag on your page and make sure to wrap my js inside a <script> tag, obviously.  My way is neater on the markup side.  If you can't get it to work it's likely a jquery conflict issue.  My version is using the $(document).ready() method to make sure all the code is loaded before it runs.
    Best,
    Chris

  • After upgrading to Mavericks App store only works for me when I switch over other users

    After upgrading to Mavericks, the only options that work for me on App Store are Updates and Purchases, anything else only works if I switch my user either to guest or root? Any idea?  Thx in advance. 

    Read this whole message before doing anything.
    Back up all data.
    Quit the App Store application if it’s running.  Wait at least 10 seconds before continuing.
    Step 1
    Hold down the option key and select
    Go ▹ Library
    from the Finder menu bar. Delete the following items from the Library folder (some may not exist):
    Caches/com.apple.appstore
    Caches/com.apple.storeagent
    Caches/storeagent
    Cookies/com.apple.appstore.cookies
    Preferences/ByHost/com.apple.appstore.plist
    Preferences/ByHost/com.apple.storeagent.plist
    Preferences/com.apple.storeagent.plist
    Leave the Library folder open. Try the App Store again. If it works now, stop here. Close the Library folder.
    Step 2
    If you still have problems, quit again and wait 10 seconds. Go back to the Finder and move the following items from the open Library folder to the Desktop:
    Cookies/com.apple.appstore.plist
    Preferences/com.apple.appstore.plist
    Test. If the App Store now works, delete the files you moved to the Desktop. Otherwise, quit again. Put back the files you moved, overwriting the newer ones that may have been created in their place, and post your results.

  • Javascript does not work in web browser

    Hello friends.
    I have a problem with javascript in my Captivate project.
    This script only works in preview in Captivate, but does not work in web browser (IE 9, Mozilla, Chrome).
    Anybody knows why?
    Thank you for your answers.

    Common JS interface
    That is the official documentation for JS in Captivate 8. For more information, have a look at Jim Leichliter's website: CaptivateDev.com - eLearning Development with Adobe Captivate

  • Flash Player only works for the account that downloaded it

    I downloaded flash player and did not specify any special preferences, however, it doesn't work for the 2 other accounts on the computer.  It only runs for the Administrator account from which i downloaded it. I'm running XP professional. Can someone tell me how to fix this?

    hi, i had already deleted cookies, temp internet files, etc;
    i only have the IE pop up blocker and blocking level set at Medium;
    it's the latest version of FP 10.0.45.2.
    I installed this version a couple of weeks ago and it worked ok for all accounts (the other 2 accounts are not admin) for a week. Then, it stopped working for all accounts, i reinstalled it (some trial and error involved), then when it finally reinstalled, only works for the one account. i just tried to reinstall from one of the other accounts and error mssg said  "failed to register"
    Date: Sun, 6 Jun 2010 11:20:59 -0600
    From: [email protected]
    To: [email protected]
    Subject: Flash Player only works for the account that downloaded it
    Hi ol, I would go to Tools, click on Internet Options and clear the Temp files. Delete Cookies, Delete Files, including the off line content. I would do this using all accounts. Also check the history files while you are there and delete those also unless you have done so recently.
    What version of Flash Player do you have Installed?
    Do you use any adblock or pop up blocker software?
    Thanks,
    eidnolb
    >

  • Safari is not working and siri only works with the phone not internet related questions.

    I have an Iphone 5 and for about 8 months it worked find, then somewhere along the line I think about the time I upgraded to the latest OS, Safari stopped working.  That is when I hit a link from email or open safari I get the browser window but nothing works, like its been blocked.  Siri of course only works with internal serches, through contacts and such.  My other browsers (crome, oprea and mercury) work fine.  I have been through all the internal settigns I can find, but nothing has worked.  Have cleared history cookes with no suceess.  Any ideas?

    Hello Mike,
    Thank you for providing so much detail about the issue you are experiencing with Safari after upgrading to iOS 7.
    The first thing I recommend is quitting and relaunching the applications on your iPhone:
    Double-click the Home button.
    Swipe left or right until you have located the app you wish to close.
    Swipe the app up to close it.
    You can find the full article here:
    iOS: Force an app to close
    http://support.apple.com/kb/ht5137
    If you are still seeing the same issue after quitting and relaunching the apps that are open, I recommend restarting your phone and then resetting if it's still not working:
    Restarting your device
    Press and hold the Sleep/Wake button for a few seconds until the red "slide to power off" slider appears, and then slide the slider.
    Press and hold the Sleep/Wake button until the Apple logo appears.
    Note: Reset your device only if you are unable to restart it.
    Resetting your device
    Press and hold the Sleep/Wake button and the Home button together for at least ten seconds, until the Apple logo appears.
    You can find the full article here:
    iPhone, iPad, iPod touch: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/ht1430
    If the issue persists, the last thing I recommend is backing up and restoring your iPhone:
    iOS: How to back up and restore your content
    http://support.apple.com/kb/HT1766
    iTunes: Restoring iOS software
    http://support.apple.com/kb/HT1414
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Client Side Javascript Validation not Working in Struts 1.x version

    hi,
    I'm following the steps provioded in the below link for Javascript Client side validation but still it is not working.I'm struggling to get this work.
    [http://www.visualbuilder.com/jsp/struts/tutorial2/pageorder/9/|http://www.visualbuilder.com/jsp/struts/tutorial2/pageorder/9/]
    "The framework automatically generates the browser specific JavaScript and validate the data only at the client side."From the above statement i undertstand that framework itself generates the javascript function for validating the field mentioned in validations.xml file so that we dont have to explicitly write a javascript function for
    validating the fields
    (or)
    Do we need to call an explicit function
    Please need help on this.
    I have followed all the steps mentioned on the above link but Client Side Javascript Validation not Working in Struts 1.x version....
    Thanks and Regards,
    Deepak

    Hi,
    Please find my steps below....still getting an error.
    2> which version of commons-validation.jar needs to be downloaded ...Link please
        downloaded the latest commons-validation.jar and placed in lib.refreshed the project,and did a build.
        3> which DTD name to be specified in "validator-rules.xml" which is in accordance to commons-validator.jar file.
    validator-rules.xml ::
    <!DOCTYPE form-validation PUBLIC
              "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
              "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">validation.xml:
    <!DOCTYPE form-validation PUBLIC
    "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
    "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
    i did as u said and im gettiong the below errorNov 5, 2009 4:33:08 PM org.apache.struts.validator.ValidatorPlugIn initResources
    SEVERE: Invalid byte 2 of 2-byte UTF-8 sequence.
    org.apache.commons.digester.xmlrules.XmlLoadException: Invalid byte 2 of 2-byte UTF-8 sequence.
         at org.apache.commons.digester.xmlrules.FromXmlRuleSet.addRuleInstances(FromXmlRuleSet.java:139)
         at org.apache.commons.digester.Digester.addRuleSet(Digester.java:1610)
         at org.apache.commons.digester.xmlrules.DigesterLoader.createDigester(DigesterLoader.java:89)
         at org.apache.commons.validator.ValidatorResourcesInitializer.initialize(ValidatorResourcesInitializer.java:122)
         at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:238)
         at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:181)
         at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1036)
         at org.apache.struts.action.ActionServlet.init(ActionServlet.java:455)
         at javax.servlet.GenericServlet.init(GenericServlet.java:212)
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
         at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
         at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3996)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4266)
         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
         at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:927)
         at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:890)
         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
         at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1150)
         at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
         at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
         at org.apache.catalina.core.StandardService.start(StandardService.java:448)
         at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
    Need help forum members.....
    Please reply to my question 1  which has been asked before as belowDo i need to write explicit javascript function for validation in Struts (or) struts generates the javascript function by itself.??? Please explain with an example....
    Edited by: Deepak_A_L on Nov 5, 2009 4:37 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Javascript function not working in template-based html files

    Does anyone have any insight as to why the following function works only in the .dwt file but not in the related html files?
    *Note: it only works in the dwt file if I change the path of:
    var imgs = new  Array('images/header1.jpg','images/header2.jpg','images/header3.jpg');
    to
    var imgs = new  Array(../'images/header1.jpg',../'images/header2.jpg',../'images/header3.jpg');
    but with the paths reading correctly (as below) in the html files it still doesn't work...
    <script type="text/javascript">
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    var imgs = new Array('images/header1.jpg','images/header2.jpg','images/header3.jpg');
    var delay = 7500;
    var counter = 0;
    function preloadImgs(){
      for(var i=0;i<imgs.length;i++){
        MM_preloadImages(imgs[i]);
    function randomImages(){
      if(counter == (imgs.length)){
        counter = 0;
      MM_swapImage('rotator', '', imgs[counter++]);
      setTimeout('randomImages()', delay);
    </script>
    </head>
    <body onLoad="preloadImgs();randomImages()">
    Any help would be appreciated!
    Andy

    Wow - now I have a real doozy for you. That duplicate function has generated itself all on its own. The script in the template file is:
    <script type="text/javascript">
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    // Comma separated list of images to rotate
    var imgs = new Array('images/header1.jpg','images/header2.jpg','images/header3.jpg');
    // delay in milliseconds between image swaps 1000 = 1 second
    var delay = 5000;
    var counter = 0;
    function preloadImgs(){
      for(var i=0;i<imgs.length;i++){
        MM_preloadImages(imgs[i]);
    function randomImages(){
      if(counter == (imgs.length)){
        counter = 0;
      MM_swapImage('rotator', '', imgs[counter++]);
      setTimeout('randomImages()', delay);
    </script>
    As you can see - no duplication.
    For some inexplicable reason, this is being added in to all the html pages based on the template:
    MM_swapImage('rotator', '', imgs[counter++]imgs[i]);
    function randomImages(){
      if(counter == (imgs.length)){
        counter = 0;
    Which explains why it works in the template file but not in any the html files. Of course, because the code is not in an editable region, I can't remove it manually from the html files. Have you ever heard of code generating itself in this manner? Or how to solve it?

  • Notification Plug-in only working in IE (not Firefox or Chrome)

    Just in case anyone else encountered this ...
    I downloaded and installed the Dynamic Action Plug-in, Notification,
    from http://www.oracle.com/technetwork/developer-tools/apex/application-express/apex-plug-ins-182042.html.
    I imported into Shared Objects plug-ins for an application, created a dynamic action using this plug-in,
    and it works great. In IE only (IE 8). When I run the application from Chrome or Firefox (3.6.13),
    the notification does not display.
    When I run the demo notification application in firefox or chrome, the notification works - http://apex.oracle.com/pls/apex/f?p=654321:401:0
    I can not find any information specifically on browsers.
    I use APEX 4.0.1.00.03 in Oracle 11.1.0.7 and develop on Windows 2003 server.
    I do use javascript (calling htmldb_Get) to get a value from the database to display in the Notification,
    so I suspect the problem may be there.
    Any ideas why only IE works would be appreciated. Is there any place in APEX I needed to specify browsers?
    Thanks,
    Wayne

    I stripped out all the local database access and hardecode a value for this problem. When you click the button "Check Employee's Classification", it calls a javascript function in the HTML Header called checkClass. That changes the item displayed in the notification and fires the dynamic action, Employee Class. Works great in IE, but that's it. I suspect it's the javascript that firefox or Chrome doesn't recognize.
    function checkClass(lnum)
    //alert(lnum);
    // force a "change" for dynamic action to fire - set to empty, then change
    $x('P1_CLASS_DESC').style.visibility = 'visible';
    $x('P1_CLASS_DESC').focus();
    $x('P1_CLASS_DESC').value = "";
    $x('P1_CLASS_DESC').blur();
    $x('P1_CLASS_DESC').style.visibility = 'hidden';
    // below won't work on apex.oracle.com - comment out
    // var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=checkClass',0);
    // get.add('P1_LNBR',lnum);
    // gReturn = get.get();
    //alert(gReturn);
    $x('P1_CLASS_DESC').style.visibility = 'visible';
    $x('P1_CLASS_DESC').focus();
    // origin - not for apex.oracle.com $x('P1_CLASS_DESC').value = gReturn;
    $x('P1_CLASS_DESC').value = "Test for why this only works in IE";
    $x('P1_CLASS_DESC').blur();
    $x('P1_CLASS_DESC').style.visibility = 'hidden';
    }

  • Zoom only works on outer parts of photo

    Very strange thing happening in LR5.6. When I go to zoom in on an image it only works on the outer 2/3s of the photo. it seems I can't zoom when clicking in the center. Same goes for when it is zoomed and I want to click the centre and drag to move to recenter the photo somewhere else. If I click on the centre it just does nothing. Also I can see that normally when I hover the mouse over the image, it shows the magnifying glass over those outer parts but when I move to the middle it just shows the mouse pointer, and same for when zoomed, the hand icon changes to mouse pointer. Anyone have any ideas what could be wrong?
    I am running a brand new iMac on OSX 10.9.4 Mavericks and have the CC version of LR installed and updated. The problem seems to be sporadic so I'm not sure if it's an Apple problem?
    AAron

    I'm having the same problem with the iWeb 09 Hit Counter on MobileMe. It worked fine until I republished the site under a new name. Now I can't get it to appear no matter what I try (including moving it around in the 150 px footer area. The javascript looks fine in the source code (see below), so I'm wondering if this is an iWeb/MobileMe bug? My hunch is that the javascript call to get the counter is not working correctly on the server end. Here's the code that also shows the proper footer value:
    <script type="text/javascript"
    src="http://web.me.com/i/chp/NGHitCounter.js"></script><script type="text/javascript"
    src="http://web.me.com/rbrisson2/.Counters/63346ED0-8119-49BB-8DE5-8EC27C322A09?webda v-method=propget&counter"></script>
    Any help on how to fix this “break” in the javascript call would be appreciated!

  • My spell check only works for about half of an article. Is there a way to fix this?

    When I'm on a wiki, looking at an article, I sometimes see a couple spelling errors that just bug me, so I sometimes go in and fix them. However, when I pull up the editing page, the spell check only works for about the first half of the article. I can't find the errors if they're in the second half of the article. Is there a way to fix this?

    You can try basic steps like these in case of issues with web pages:
    Reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Hold down the Shift key and left-click the Reload button
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (Mac)
    Clear the cache and the cookies from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Spry:select only works on double or second click

    Why when using the spry:select does it only work once I have
    double-clicked
    I have put the ".selected" class at the bottom of my css
    style sheet so it will be picked up correctly
    here is the link and below is a snippet of code
    http://www.studio-rasa.com/Store/Store_View_All2.html#
    (if you test out the link above, you can see that I'm trying
    to get the background color of the link to be gray once they are
    clicked. However, they only turn gray once it has been clicked
    twice)
    <li><a href="#" onclick =
    "dsCategories.setCurrentRow('1');"
    spry:select="selected">Oil</a></li>
    <li><a href="#" onclick =
    "dsCategories.setCurrentRow('2');"
    spry:select="selected">Pastel</a></li>
    <li><a href="#" onclick =
    "dsCategories.setCurrentRow('3');"
    spry:select="selected">Watercolor</a></li>

    Hi,
    Was there a solution to this? I've come across it as well.
    What causes this for me is when I'm using nested data sets. Here it
    is in a simplified example:
    <?xml version="1.0" encoding="UTF-8"?>
    <specials>
    <menu_item id="1">
    <item>Summer Salad</item>
    <ingredients>
    <ingredient id="1">tomatoes</ingredient>
    <ingredient id="2">lettuce</ingredient>
    <ingredient id="3">onions</ingredient>
    </ingredients>
    </menu_item>
    <menu_item id="2">
    <item>Thai Noodle Salad</item>
    <ingredients>
    <ingredient id="1">tomatoes</ingredient>
    <ingredient id="2">noodles</ingredient>
    </ingredients>
    </menu_item>
    </specials>
    <script type="text/javascript">
    var dsSpecials = new Spry.Data.XMLDataSet("data.xml",
    "specials/menu_item");
    var dsIngredients = new
    Spry.Data.NestedXMLDataSet(dsSpecials,"ingredients/ingredient");
    </script>
    <style>
    .row_selected {font-weight: bold;}
    </style>
    <div id="specials" spry:region="dsSpecials
    dsIngredients">
    <table>
    <tr spry:repeat="dsSpecials" spry:select="row_selected"
    spry:setrow="dsSpecials">
    <td>- {item}</td>
    <td><span
    spry:repeat="dsIngredients">{dsIngredients::ingredient}
    </span></td>
    </tr>
    </table>
    </div>
    This works (i.e. class is applied properly on a single click)
    if:
    1) I remove the spry:setrow="dsSpecials"
    OR
    2) I remove the nested data: i.e. (remove dsIngredients from
    spry:region attribute in the div and the second <td> tag)
    Thanks

Maybe you are looking for

  • Null pointer exception in jserv.log

    Genius, I am facing weired exception "Null pointer exception" in jserv.log. Apps Login is showing "internal server error" I tried enabled debug log level in jserv.conf, httpd.conf, all logs are having Null pointer exception message. not able to trace

  • Return sales order

    Dear All,             While processing return sales for sales kit (IS R),which contains two sub items,pricing is done for main item,sub items are not there in invoice as they are not relevent for pricing but what if i need to create return order of o

  • Will mountain lion support safari 5.1?

    will mountain lion support safari 5.1?

  • Java2 runtime environment for Solaris 2.5.1 ?

    Hi, I need to run Java2 applications on Solaris 2.5.1 (SunOS 5.5.1) Can I install Java2 runtime environment on Solaris 2.5.1? Which version of JRE should I have? Any advise will be appreciated.

  • Transporting Dashboard from BI Dev to BI Prd

    Hi all, I have created a dashboard in visual composer and in the system i choose BI Dev server. Now I want to transport that dashboard to BI Prd. Is there any way to do this? Best Regards, AI.