Iam using two scripts that fire at the same time. They seem to cause a conflict. The question I have is how can I get one to fire a half a second to a second after the other fires? I think that might solve the issue I am having.
Note I did not post the scripts here a they are irreverent. I just need to know how to delay one from firing until the other has. Also the one I want to fire last is at the bottom of the HTML the other is in the head. Also the two scripts are completely unrelated to each other in what they do.
EDIT This question stems from another question i posted. Here - Javascript/Fancybox Error? - I thought about it and would like to try to add a delay but I am also curious as how to add the delay anyway that is not related to the issue I am having.
Two scripts cannot fire at the same time. Javascript is single threaded and no two scripts ever run at the same time. One will run to completion, then the next one will run. If there is a conflict between the two, then it has to do with how the scripts are written and we could only help you solve that problem by seeing the scripts and the context that causes them to run.
Also, it may be relevant that anything you attempt to run in the head tag when the script is loaded cannot manipulate the browser DOM because it is not in place yet. It would have to be delayed until the DOM is successfully loaded and ready for manipulation.
I am not sure how totally unrelated scripts can affect each other, may be these un related scripts are affecting global properties which they use and hence go bonkers. There is a concept in JS that let you run two JS scripts in parallel, this is known as web workers. John Resig, the jquery guy, have published an article long ago and I found it using Google. -workers/. Using web worker you can start your 2nd script after one second or any time. I am not a JS ninja but I think it may help you. But still, w/out you posting your code it is hard for others to suggest you something. After looking at your edit, I can suggest you to explore settimeout in JS. Another link from same article -javascript-timers-work/
I have many projects that I want to base that project and all needs to have same tags event. I want a simple way to configure and update all projects and using an inheritable project semms to be the bes way to do it.
Startup and Shutdown scripts from an inheritable project should not run. If they do, this is most probably a bug.
Are you sure it is not an other, runnable project that is executing those scripts? I am not sure, but i think inherited projects may shutdown and restart when a 'parent' project is changed.
My website is image intensive which means images take up a huge amount of my page load time.I am using the google maps API which works better if run on a window load event, however given that window load waits for all images to load first, the user experience on the map is affected negatively to an extent.
This can be remedied if I can get a separate event that targets just the completion of loading for the script files and begins rendering the map without concerning itself about the status of the images.
PS : Since I am loading my maps with the cluster module, I have no other option but to wait for all the scripts to load first, hence document ready is not an option. Also loading scripts before the map initiation js doesn't work since the map clustering always occurs with a delay loading external javascript and hence I have to rely on window load.
Unfortunately, if the scripts you are loading further load more scripts, you can't really detect that other than watching for specific properties of the window to become available using a setInterval.
With that said, if images are the bottleneck, you may want to look in to lazy-loading them using some kind of plugin (jquery one referenced). this keeps bandwidth low, load time fast, and content remains "on-demand" (if they scroll down they'll get the additional content, otherwise it's never loaded).
Hi All - I am on 7.6.1.3 and have escalation that executes an action launchpoint automation script that updates a workorder. I have coded the setValue to noaction(see below). I do not have a save() on mboset but records are saved and updated without that and all is working good - except other workorder automation scripts that have save launchpoints are also executing and I don't want that. I thought the noaction would prevent other scripts from executing ? Any insight one what I am doing wrong?
There are two things to consider, for a given Object / Attribute etc you should only have a single script that owns the launch point. If you want to break your script up into multiple scripts, do so and then call those scripts from the one that owns the launch point. This way you have control over which scripts fire and what order the execute in.
This lets you have an entry point within the script from which you can exit. So anywhere in the process you can call return and stop execution without worrying about falling through and executing something unexpected.
The script removes all of the amazon apps, and loads google play, and other google services. It installs nova launcher, to replace the firelauncher, and loads launcher hijacker so you can use it.
next it installs Fully Kiosk browser so you can set actiontiles as the home screen.
Lannouncer lets you use the tablet as an endpoint in smartthings for announcements.
Your tablet should be on Fire OS 5.4.0.0 to enable ALL the features of this script, however, you can use it with other OS versions or even other android tablets. It will not be able to remove the amazon apps from a tablet that is above 5.4.0.0, however other functions should work fine.
Any configuration changes that this makes are not permanent, and will not brick your device.
To restore to factory, you can hook up and run the reboot to recovery option, and just factory reset the fire, or do it through the Fire OS settings menu.
Here is a link to it, I would appreciate feedback, but I can not take credit for all of the work. a good majority of this, including the section that removes apps comes from the guys over at XDADevelopers.
Usage Instructions
Assuming a brand new fire, that has not been unboxed yet. - If you have 5.4.0.0 as the OS version, I would NOT let it update and would run option 1 to block OTA updates (or e for everything).
Unbox Device.
Turn it on, choose your language.
Attempt to join a network but use a bad password!
After using a bad password, hit cancel and skip connecting wifi.
Go into settings, about device, and then you need to tap on the serial number about 10 times to enable developer options.
Enable usb ADB.
Plug into a windows computer, and allow it to connect to the fire (security popup on tablet)
Extract the folder above to your desktop, for example: desktop\fire utility
Inside the folder, run the FileUtility.bat program.
You do no need to run as an administrator.
Choose what you want to do from inside the utility.
Swing back here and let me know you used it, and if there are any improvements I can make. Looking at adding in a fully config file that would just require you to login to action tiles, (and/or dakboard).
BETA VERSION
Here is a beta version of the script, with some updates. Still not clearing out some apps due to the security put in on tablets in later firmwares, but it has some new features, and is a much smaller download now. Please comment bugs, suggestions, etc.
3a8082e126