w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Calling code after jQuery getScript executes the script
You should be able to do this quite easily using getJSON. http://api.jquery.com/jQuery.getJSON/ Something similar to this should do the trick: $.getJSON( url , function(data) { //Do something with data here alert(data); }); EDIT: The answer from the link below that I find most interesting is this one: $.ajax({ url: url, dataType: 'script', success: success, async: false }); It seems that disabling the asynchronous part of ajax will execute the script first, then the callback afterwords, instead of doing them synchronously.

Categories : Jquery

gmaven/groovy call script function from another script
Groovy Script is saved as class. So you have two ways to call the method from a script in another. //Script Foo.groovy def foo(){ println "hello" } //Script Baz.groovy def static baz(){ println "static hello" } //Script Bar.groovy new Foo().foo() //prints hello Baz.baz() //prints static hello

Categories : Maven

Injecting data into jQuery $.getScript call
The .getSCript() does not provide that functionality, but I think you can make use of closure here Ex: for(var i = 0; i < x; i++){ (function(idx){ $.getScript(path, function (e2) { console.log(idx); }); })(i); }

Categories : Jquery

pass partial list of arguments from the parent script to the child script
Use shift to remove the first two arguments: shift 2 child_script "$@" If you need to use $1 and $2, you can save them in variables first. Another option is to assign the arguments to an array: args=("$@") remove the first two elements of the array: unset args[0] unset args[1] Then call the child script with this array: child_script "${args[@]}"

Categories : Bash

Loading pre-compiled script in RemObjects Pascal Script (Delphi)
Rather than the how of this, I am going to counter with why? Compiled scripts will likely be version bound, probably even platform/target bound - and they usually compile fast enough that you never notice the time hit. Are you really use the scripts intensely enough that compile time is an issue? Sometimes the best answer is "do you really need to do this at all?"

Categories : Delphi

How do I load an edge animation with an AJAX call? jquery getScript fails
You probably just want to load the adobe edge file directly instead of injecting another preloader inside of a preloader. But if you just want to load things asynchronously with a preloader (yepnope for instance) then including the file like you have commented out is exactly how it should work. If you wanted to switch it to use jQuery's getScript you could just switch out the yepnope specific stuff. Unfortunately the preloader file has a bunch in it, but I think it's boilerplate for Adobe Edge. It's like something you'd switch out when you weren't in an example. So your line that looks like this: $.getScript("page_a_edgePreload.js", function(data, textStatus, jqxhr) {}); Should change to this: $.getScript("edge_includes/edge.1.5.0.min.js", function(data, textStatus, jqxhr) { // Ado

Categories : Jquery

In Embedded Octave C++ how do I execute a script file? ("error: invalid call to script")
You should be using the function source_file() rather than eval_string(). Take a look into the parser.h file which unfortunately doesn't have a lot of comments. The names are quite self-explanatory so you shouldn't have a lot of problems. Also, you're pretty much trying to reimplement Octave's source function. If you really want to implement it again, look into the oct-parse.cc file (generated during the build process with flex and bison).

Categories : C++

Bash script to wait for gnome-terminal to finish before continuing script, only works for first instance of script
#!/bin/bash date bash -c "sleep 7" & bash -c "sleep 5" & wait date As you can see while running this script, both sleep commands will run in parallel, but main thread stalls, while they are running. Sat. Jule 27 01:11:49 2013 Sat. Jule 27 01:11:56 2013 Replace sleep 7 with expect launchneuron.exp and sleep 5 with expect launchmpj.exp and add your plot commands after calling "wait": echo "Simulation Complete" ...(your code to plot results)

Categories : Bash

PowerShell - script 1 calls script 2 - how to return value from script 2 to script 1
You could make use of ProcessStartInfo and Process which would allow you to read the StandardOutput. Here's an example of what you might do: $startInfo = New-Object System.Diagnostics.ProcessStartInfo $startInfo.FileName = "powershell.exe" $startInfo.Arguments = "C:scriptscript2.ps1" $startInfo.RedirectStandardOutput = $true $startInfo.UseShellExecute = $false $startInfo.CreateNoWindow = $false $startInfo.Username = "DOMAINUsername" $startInfo.Password = $password $process = New-Object System.Diagnostics.Process $process.StartInfo = $startInfo $process.Start() | Out-Null $standardOut = $process.StandardOutput.ReadToEnd() $process.WaitForExit() # $standardOut should contain the results of "C:scriptscript2.ps1" $standardOut

Categories : Powershell

Google Apps Script Spreadsheets - Assign script to image from a script
This would be a cool feature, but here is a possible workaround, it might even offer more functionality. You can build a UI using Google API. More detailes here. The UI allows you to create side bars/menus/etc. You could even create floating dialog windows. Using AbsolutePanel, you can even choose where the dialogue shows up.

Categories : Google Apps Script

unable to access variable declared in ksh script to csh script using shell script
The ksh script is not doing what you think it is doing when used by ksh; it sets $1 first to MyUser=root and then MyPassword=shroot. However, when you source it from your C shell script, because the syntax is compatible with C shell (checked with tcsh), you would set the two variables. If you sourced the script from a Bourne-shell derivative, the exit at the end of the ksh script would cause the shell to exit; it does not seem to cause the C shell to exit. So, what you've got is a weird hybrid. Normally, you stick to one language and use it exclusively. Where you need to use another shell, you can do so, but you simply run the script written for the other shell. You can communicate to the other script with environment variables. You don't normally try writing sourceable code that ca

Categories : Shell

Powershell start-process script calls a second script - how to make one script only
Windows does not allow a process to elevate while running. There are some tricks but in one way or another they will spawn a new process with the elevated rights. See here for more info. So the easiest way for PowerShell is still using one script to Start-Process the other script elevated.

Categories : Powershell

Loading HTML using JQuery's getScript multiple times after the HTML is removed over and over
From http://api.jquery.com/remove/ Similar to .empty(), the .remove() method takes elements out of the DOM. Use .remove() when you want to remove the element itself, as well as everything inside it. In addition to the elements themselves, all bound events and jQuery data associated with the elements are removed. To remove the elements without removing data and events, use .detach() instead. So all events bound on the div and its descendants will be removed and can be safely rebound. However if the JavaScript you are injecting binds events to things outside the div like the document, window, body etc.. multiple events will be bound which will likely cause problems if unintended. As of jQuery 1.4, the same event handler can be bound to an element multiple times. This is especially

Categories : Javascript

need to call a php script from bash script through eval
There are still some parts of your script that I don't understand, or not sure it does really work, but about your question, I think your callback could only work if you place it on a function like: function mycallback { php /srv/www/scripts/mage/install-invoke-app.php } And call your install_repolist function as install_repolist $gitRepos 0 mycallback That should make your php command call with the file argument work but there is one thing: I don't think values of gitRepos could actually be passed like that. Most parts of your code has variables that actually needed to be quoted around double quotes "". One problem with it is that your php command would just end up in the final place where it is executed as one single argument php and no longer with the file due to word splitti

Categories : PHP

how to make a php/ajax script to show text depending on function of php script
Add a div to your 'myDiv' call it with an id 'message' and change it with javascript accordingly when calling the functions? $('#ajaxMessage').html('My message'); Hopefully this answers your question.

Categories : PHP

How javascript function are loaded in the script tag
1.Are these functions retrieved from js files or any other mechanism? No, built-in functions are part of the language and most likely implemented in C or C++. However, since JavaScript is a dynamic language, a built in function could be re-defined somewhere by a Javascript function. For example: String.prototype.substr = function () { return 'Take that, built-in function!'; }; var s = 'Hello'; window.alert(s.substr(1,2)); 2.If yes where are they located? See answer 1. However, with open-source JavaScript engines you'd be able to dig up the source code online if you were curious about the implementation of these built in functions. For example, the source code to V8, the JavaScript engine Chrome uses, can be found here. One way to tell if a function is native would be to p

Categories : Javascript

is there any way of calling javascript function in