Load javascript after updateContent

Hi,
I am loading an html page into another html page using
Spry.Utils.updateContent(). In the source file, load some
javascript and styles on page load. So:
Spry.Utils.addLoadListener(function() {
hideRows();
Spry.$$("#tblReportNoInnerBorder
tr:nth-child(2n+1)").addClassName("rowColored");
Spry.$$("td#expandCommission").addClassName("expandButton");
Unfortunately, these styles are not loaded when the
destination file loads. I'm guessing because the source file is
never really loaded as a page (only the destination page is).
So, I moved this call to the destination file like so:
<script type="text/javascript">
Spry.Utils.addLoadListener(function() {
updateLoadedToDiv();
Spry.Utils.addEventListener("decSection", "onPostLoad",
hideRows, false);
hideRows();
Spry.$$("#tblReportNoInnerBorder
tr:nth-child(2n+1)").addClassName("rowColored");
Spry.$$("td#expandCommission").addClassName("expandButton");
function updateLoadedToDiv(event) {
Spry.Utils.updateContent("decSection", "totalSummary.html");
</script>
This still doesn't work though. Can someone please help me
out. I'm going crazy because it's not working!

Why not use the finish function function of update content?
Spry.Utils.updateContent(ele, url, finishFunc, opts)
function updateLoadedToDiv(event) {
Spry.Utils.updateContent("decSection",
"totalSummary.html",function(){
hideRows();
Spry.$$("#tblReportNoInnerBorder
tr:nth-child(2n+1)").addClassName("rowColored");
Spry.$$("td#expandCommission").addClassName("expandButton");
this will probably solve your problems.
The loadlistener doesn't get called because the document it
gets loaded in is already loaded

Similar Messages

  • Takes longer then normal to load hotmail after submitting user credentials and doing this on other websites

    firefox takes longer to load webpages after submiting user credentails on websites such as hotmail or banking websites. this has been doing this since i upgraded firefox. also been experiencing alot of firefox crashes since the upgrade. firefox is usually a better and faster brouwser then IE9.

    -> Tap ALT key or press F10 to show the Menu Bar
    -> go to Help Menu -> select "Restart with Add-ons Disabled"
    Firefox will close then it will open up with just basic Firefox. Now do this:
    -> Update ALL your Firefox Plug-ins https://www.mozilla.com/en-US/plugincheck/
    -> go to View Menu -> Toolbars -> unselect All Unwanted toolbars
    -> go Tools Menu -> Clear Recent History -> ''Time range to clear: '''select EVERYTHING''''' -> click Details (small arrow) button -> place Checkmarks on '''Cookies & Cache''' -> click "Clear Now"
    -> go to Tools Menu -> Options -> Content -> place Checkmarks on:
    1) Block Pop-up windows 2) Load images automatically 3) Enable JavaScript
    -> go to Tools Menu -> Options -> Privacy -> History section -> ''Firefox will: '''select "Use custom settings for history"''''' -> REMOVE Checkmark from "Permanent Private Browsing mode" -> place CHECKMARKS on:
    1) Remember my Browsing History 2) Remember Download History 3) Remember Search History 4) Accept Cookies from sites -> select "Exceptions..." button -> Click "Remove All Sites" at the bottom of "Exception - Cookies" window
    4a) Accept Third-party Cookies -> under "Keep Until" select "They Expire"
    -> REMOVE CHECKMARK from CLEAR HISTORY WHEN FIREFOX CLOSES
    -> go to Tools Menu -> Options -> Security -> place Checkmarks on:
    1) Warn me when sites try to install add-ons 2) Block reported attack sites 3) Block reported web forgeries 4) Remember Passwords for sites
    -> Click OK on Options window
    -> click the Favicon (small drop down menu icon) on Firefox SearchBar (its position is on the Right side of the Address Bar) -> click "Manage Search Engines" -> select all Unwanted Search Engines and click Remove -> click OK
    -> go to Tools Menu -> Add-ons -> Extensions section -> REMOVE All Unwanted/Suspicious Extensions (Add-ons) -> Restart Firefox
    You can enable your Known & Trustworthy Add-ons later. Check and tell if its working.

  • Automatically Load JavaScript Files in PagePhaseListener

    Hello.
    In my application I want to load JavaScript files automatically on each page load or navigation. It can be done by using af:resource, but what I want that in my application I do not want to load each and every JavaScript files for every page. I needed an unification. So I have implemented a custom PagePhaseListener:
    public class MHISPagePhaseListener implements PagePhaseListener {
    public MHISPagePhaseListener() {
    public void afterPhase(PagePhaseEvent pagePhaseEvent) {
    public void beforePhase(PagePhaseEvent pagePhaseEvent) {       
    if (pagePhaseEvent.getPhaseId() == Lifecycle.INIT_CONTEXT_ID){       
    String function = "function loadJSFile(filename) {" +
    "var headID = document.getElementsByTagName('head')[0];" +
    "var newScript=document.createElement('script');" +
    "newScript.type = 'text/javascript';" +
    "newScript.src = filename;" +
    "headID.appendChild(newScript);" +
    "}" +
    "loadJSFile('/hennessy/js/js/jquery-1.7.1.min.js');"+
    "loadJSFile('/hennessy/js/document.ready.js');"+
    "loadJSFile('/hennessy/js/jflow.plus.js');"+
    "loadJSFile('/hennessy/js/ui/jquery.ui.core.min.js');"+
    "loadJSFile('/hennessy/js/ui/jquery.ui.widget.min.js');"+
    "loadJSFile('/hennessy/js/ui/jquery.ui.tabs.min.js');"+
    "loadJSFile('/hennessy/js/ticker/jquery.ticker.js');";
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExtendedRenderKitService service = Service.getRenderKitService(facesContext, ExtendedRenderKitService.class);
    service.addScript(facesContext, function);
    Now when the page loads I can see all of these JavaScript files in HEAD, but my home page contains a TaskFlow and the view pagefragment of that TaskFlow contains $(document).ready(); and I get $ is not defined. That means the beforePhase() method is executing after the load of TaskFlow.
    How can I solve this problem and how can I achieve this unification? Is there any way to register all JavaScript files globally?
    Thank you.

    I have a Page Template from where all the pages are evolved. Say for example: Home page. It is based on PageTemplate and in the Home page I have added that TaskFlow. Now if I add af:resource s in PageTemplate to add all the JavaScript files, then the $(document).ready(), written in bottom of the View of the TaskFlow, gave me *$ is not defined*.
    Where and how should I add the JavaScript files in the Template in order to achieve this? I really appreciate you help.
    Thank you.

  • How can I automatically close a dialog box using Javascript after I click the OK button to submit it?

    How can I automatically close a dialog box using Javascript after I click the OK button to submit it? I don't want to have to X out of the dialog box after I am done.
    Thanks
    Linda

    JS can not interact with open dialogs in any way, unless it's a dialog
    created in JS using the Dialog object.
    On Thu, Jul 24, 2014 at 11:13 PM, lindaeliseruble <[email protected]>

  • I have iphoto 9.2.1 and it will not load. The loading screen after I click on the app keeps circling. Can anyone help Please?

    I have iphoto 9.2.1 and it will not load. After I click on the app it opens but the screen continousley tries to load. Please Help

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • When turning on my mac book pro it displays a screen with apple logo and begins loading a loading bar, after this continues to show loading circle however has been like this all day still no different. Tried turning it on and off however still same!

    When turning on my mac book pro it displays a screen with apple logo and begins loading a loading bar, after this continues to show loading circle however has been like this all day still no different. Tried turning it on and off however still same!

    ... then run Disk Utility, Repair Disk.
    Also:
    Resolve startup issues and perform disk maintenance with Disk ...
    Mac troubleshooting FAQ: start-up woes
    How To Fix Common Mac Startup Problems
    Mac Stalls on Gray Screen at Startup - Troubleshooting Mac Startup ...

  • Why Won't Launchctl Load Script After Reboot?

    Hello,
    iMac with OS X 10.7.3
    root# ls -lah /Library/LaunchAgents/dbase_backup.plist
    -rw-r--r--  1 root  wheel   479B Feb 24 10:24 /Library/LaunchAgents/dbase_backup.plist
    I load it with:  root# launchctl load /Library/LaunchAgents/dbase_backup.plist
    Runs fine until reboot.
    Any idea how to make this to load automatically after a reboot?
    NOTE:  I originally posted at https://discussions.apple.com/thread/3820415?start=0&tstart=0.  But, we couldn't resolve the issue.  Any new ideas here?
    Thanks!

    Hi,
    i was on same trouble.
    i has found this in console:
    16.09.13 17:31:38,960 com.apple.launchd.peruser.501[183]: (com.myscript.track[39511]) Exited with code: 1
    so i have added error logging to my plist and found the problem in /tmp/matrack.err:
      <key>RunAtLoad</key>
      <true/>
      <key>StandardErrorPath</key>
      <string>/tmp/matrack.err</string>
      <key>StandardOutPath</key>
      <string>/tmp/matrack.out</string>
    </dict>
    hope this helps.

  • Accidentally exited out of the loading screen after making my purchase, should I retry or how do I check if the payment went through?

    Accidentally exited out of the loading screen after making my purchase, should I retry or how do I check if the payment went through?

    check your account, https://www.adobe.com/account.html

  • I now get an 500 Internal Server error when loading Firefox, after updating RealPlayer

    I now get an 500 Internal Server error when loading Firefox, after updating RealPlayer.
    When I try to open Firefox, it opens. But there is the error message.
    What is this? How do I did rid of it?
    '''bold text'''

    Clear the cache and the cookies from sites that cause problems.
    * "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites causing problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    You can also check the connection settings in Tools > Options > Advanced : Network : Connection<br />
    If you do not need to use a proxy to connect to internet then select "No Proxy"
    See "Firefox connection settings":
    * [[Firefox cannot load websites but other programs can]]

  • Using spry:state="loading" only after a certain interval

    Hi everyone ,
        I need a feature for spry regions. I want my loading spry state to show only loading of data takes 0.5 seconds and more.
    Is it possible with this version of spry?
    Ps1 : you can find a live example of my need in google webmaster tools' content section,content by title page. There is an ajax listview with paging on page and loading div only apeears if loading of data takes more than a certain milliseconds.
    Ps2 : Spry rulezzzz

    vw2ureg wrote:
    Hi,
    Go here and scroll down to ErrorState, LoadingState and ReadyState.
    I hope this helps.
    Ben
    That will only tell Spry that it should should use different "state" as loading state. But it doesn't display a loading state after a certain interval. This functionality does not exist in the Spry library. But you could create a custom "loading" state that you automatically trigger using setTimeout if your haven't gotten a onPostUpdate through your region observer.
    But i'm curious why you would wanna do create a have the loading state after a certain interval.

  • Firefox does not stop loading even after the site is loaded and continues as if it is still loading. I have clocked it to 15 minutes, why?

    Firefox does not stop loading even after the site is loaded and continues as if it is still loading. I have clocked it to 15 minutes, why? edit
    Details

    Sorry, I should distinguish between slow loading and manual reloading.
    I understood your problem to be that Firefox never finished loading the page, i.e., some part of the page was loading too slowly.
    By reloading, I meant Ctrl+r (or the reload button), to manually reload the page. You can disregard any cached files and reload all content fresh from the server by adding the Shift key, i.e., Ctrl+Shift+r (helpful when specific sites do not load correctly).
    If the page is automatically reloading itself over and over, that sounds like a completely different problem.

  • IPhoto wont load even after trying to rebuild

    My iPhoto '11 won't load even after I have tried rebuilding it by simply resoting and by trying to rebuild it from a back up. Does this mean that I need to manually rebuild it by pressing the option key before opening iPhoto? Will I lose data by doing this?

    Make a back up first.
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • Itunes songs won't populate in the audio browser for slideshow. Says that they are loading, but after 2 hours gave up. How do I fix this challenge?

    itunes songs won't populate in the audio browser for slideshow. Says that they are loading but after 2 hours I gave up. How do I fix this challenge?

    Can you access the iTunes Library in other app? IPhoto? IMovie? If not, then I'd bring that to the iTunes forum

  • WARNING: Premiere CS6 won't load past "Loading ExporterQuickTimeHost" after QT 7.7.3 update

    Just what the subject line says, Premiere CS6 won't load up past the splash screen and "Loading ExporterQuickTimeHost" after I updated to QT 7.7.3 (Win7).  No other updates done, my CS6 is up to date.  I reverted back to 7.6 and problem went away.  Just an little word of warning to those who see the update pop up.
    If you run into the problem, here's the link to download 7.6.  You will have to uninstall 7.7.3 then instal 7.6.
    http://support.apple.com/downloads/#quicktime

    I ran into a similar issue on Premiere Elements 11:  On program launch, the system hung on "Quicktimehost.pm".  After some troubleshooting with no success, I:
    1) Uninstalled Quicktime version 7.7.5
    2) Installed Quickitme version 7.6
    3) rebooted my machine
    4) SUCCESS-> launched Premiere Elements 11 without issue
    Hope this helps a few others!

  • Firefox Not Loading Websites After Update

    ''locking this thread as duplicate, please continue at [https://support.mozilla.org/en-US/questions/1053378 /questions/1053378]''
    Firefox has stopped working after latest update. I can open it up but then it wont load any websites. It just keeps loading. After if I close it and try to re-open it I get the following error message: "Firefox is already running, but not responding. The old firefox process must be closed to open a new window" and it never opens. If I try to end the process in task manager I can't as it doesn't do anything when I attempt to end the process. Then the only way I can get back on firefox is to restart my computer. This is happening on both my PC and my Laptop both running Norton Security Suite.
    Please HELP! as I have tried everything and nothing fixes it. I have tried the following troubleshoot solutions with no luck:
    1) Reinstall Firefox
    2) Refresh Firefox
    3) Removing Firefox from the list of accepted programs in firewall and then adding it back (this was done through Norton as it is managing my Windows Firewall)
    4) Creating a new profile and using that one instead
    5) Starting Firefox in Safe Mode
    6) Updating firefox
    7) Updating Norton
    Nothing seems to be Working and I'm starting to get frustrated. Any Help is appreciated. Thanks

    It is possible that your security software (firewall, anti-virus) blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
    Remove all rules for Firefox and the plugin-container from the permissions list in the firewall and let your firewall ask again for permission to get full, unrestricted, access to install for Firefox and the plugin-container process and the updater process.
    See:
    *https://support.mozilla.org/kb/Server+not+found
    *https://support.mozilla.org/kb/Firewalls
    *https://support.mozilla.org/kb/fix-problems-connecting-websites-after-updating
    Boot the computer in Windows Safe Mode with network support (press F8 on the boot screen) as a test.
    *http://www.bleepingcomputer.com/tutorials/how-to-start-windows-in-safe-mode/

Maybe you are looking for

  • Help, iTunes can't find my music

    I am trying to make space on my mac book pro HD because I am switching over from a 500gb 7200RPM drive to a 128 solid state HD. I moved my iTunes library over to an external drive and set the folder in preferences to point at the Itunes library on th

  • MS Exchange 2013 certificate error.

    we just setup Exchange 2013 but I cant configure outlook . it brings two error messages. 1. There is a problem with a proxy server's security certificate. the name on the certificate is invalid or does not match the name of the target site. 2. The co

  • Since upgrading to Mavericks, my works suite disappeared

    I upgraded to Mavericks on my MacBook Pro in April.  Since then, I no longer have my Works Suite.  I have no way to write letters, make notes, or anything to do with word processing.  I have read the reviews of the updated Pages and don't want to pur

  • Personal

    2 weeks ago I took the ORACLE 9i PL/SQL programming course at oracle university. I was told by the instructor that I could go to otn.oracle.com and download Oracle 9i database (personal) and I'd be able to do the class exercises from home using usern

  • Basic basics of PP and its hijacking Bridge

    I just got this program and looked at some tutorials, and some of the other things about getting started,overview, basics etc.   This is my first version.  Unlike with other programs that have manuals or built in help, I have been unable to find anyt