w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to open new tab instead of new window in Chrome in java scripts
Use _blank instead of "_new" It will instruct the browser to create a new browser tab or window when the user clicks on the link. As per reference: _new is not valid Demo: http://jsfiddle.net/eH9tw/

Categories : Javascript

External JS scripts blocked by hosting company?
The company doesn't have any control over what scripts are being loaded inside the browser. If you put a bunch of tags in the HTML of your site, there is no way that the company can do anything at that point.

Categories : Javascript

Contexts and methods for communication between the browser action, background scripts, and content scripts of chrome extensions?
It's been some time since I have had to deal with chrome's extensions. I remember it was quite a struggle before I got how things worked. In order for your extension to communicate with the browser it's easy you use your javascript/background file, and to communicate with the webpage you need to use chrome.tabs.executeScript but that's really tricky and can be a real pain in the butt. I suggest you take google's tour on extensions and give their api a really good overlook, everything's in there! I wish you good luck and I hope this answer has helped you! :P

Categories : Javascript

Blocked insecure content chrome
All your assets and objects being loaded should all come from SSL. Normally what is happening here is that you are calling something like a script or css file that is pointing to http rather than https. Your best bet is to load all resources and assets using schemeless urls src="//somedomain.com/asset.css" for example.

Categories : Google Chrome

Blocked iframe in google chrome
I am afraid I do not have the reputation of marking it as a possible duplicate. Hence my only option is to paste the link here. Hope it helps. Unsafe JavaScript attempt to access frame with URL - in the same domain

Categories : Javascript

how to check flash plugin is blocked in Chrome
You could use something like swfobject to handle flash detection, but something like this should also work; var flashAvailable = false; try { var flash = new ActiveXObject('ShockwaveFlash.ShockwaveFlash'); if(flash) { flashAvailable = true; } } catch(e) { if(navigator.mimeTypes ["application/x-shockwave-flash"] != undefined) { flashAvailable = true; } }

Categories : Javascript

Keep google chrome extension ContentScripts working while javascript is blocked
Just in case someone stumbles upon this: There currently is no way in keeping functions of a contentScript running while JavaScript is disabled. Probably this feature will never be implemented, but who knows. You are still able to execute some code though e.g. DOM Manipulation is still possible, hence the menu I wanted to inject was still displayed.

Categories : Javascript

Chrome call function in content scripts from background.js
To call a function in the content script from the background page, you first need to know the tab id. contextMenus.onClicked event has a tab parameter containing that id. Then use message passing to do it. For example, in your background page: chrome.contextMenus.onClicked.addListener(function(info, tab) { if (tab) chrome.tabs.sendMessage(tab.id, {args: ...}, function(response) { // ... }); }); In your content script: chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { sendResponse(myFunc(request.args)); });

Categories : Javascript

Methods of removing the youtube iframe api console error - "blocked a frame with origin..." in chrome console
I had a similar error where the JS error was: Blocked a frame with origin "https://www.youtube.com" from accessing a frame with origin "http://www.yourdomain.com". The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocol/Protocols must match, YouTube has CORS (Cross Origin Resource Sharing) enabled to allow across domains. Try getting rid of the https:// in your YouTube iframe tag? You could also take a look at your closing iframe tags. Iframe tags are not singleton tags and must end with a </iframe> and not a />.

Categories : Javascript

Strange behaviour in Chrome when using document.write for Scripts in iframe
The Unicode escape of the backslash should work: doc.write('<script type="text/javascript"><u002Fscript>') Use try/catch to escape the semicolon: try{;}catch(e){} Use appendChild or other DOM methods as a better alternative. References The end-tag open (ETAGO) delimiter

Categories : Javascript

chrome extension use the same socket.io connection under background page and content scripts
I tried to write a socket.io client in content script which will send message to background page when socket.io server send "hello" request. Content Script: var socket = io.connect('http://localhost:1337'); socket.on("hello",function(data){ console.log(data.text); chrome.runtime.sendMessage({msg:"socket",text:data.text},function(response){}); }); Background page: chrome.runtime.onMessage.addListener( function(request,sender,senderResponse){ if(request.msg==="socket"){ console.log("receive from socket server: "+request.text); } } ); Server side: var app = require('http').createServer(handler).listen(1337); var io = require('socket.io').listen(app); function handler(req,res){ console.log(req.url); res.writeHead(200, {'Content-Type'

Categories : Javascript

Chrome extension not loading injected scripts with "charset" in MIME type
I don't think that is how you specify charset. I.e. although it may be a valid addition to the type, the browser may only automatically run text/javascript and application/ecmascript exclusively. I don't know, but try this; script.type = 'application/ecmascript'; script.charset = 'UTF-8';

Categories : Javascript

Java concurrency - is monitor blocked?
Is there a way to tell from one thread (say the one which locks a monitor object) if another thread is block/waiting on same monitor? No, not from the object itself. You can, as @Evgeniy mentioned, use other of the java.util.concurrent.locks.* classes which allow you to view the queued members, but not from a synchronized (lock) type of object monitor. I would like the collector to know that when he finishes collecting, a possible data update is pending which yield the collected data might already be invalid. How about having a BlockingQueue of updates so the collector could check the queue and see if it is non-empty. The updater thread(s) would just be adding Update information to the BlockingQueue and the collector would dequeue the updates and make the adjustments. It then

Categories : Java

*What* Java "security settings have blocked a local application from running"?
It was officially stated (Oracle's response to my school-team's email) that some older remains of virtual machines may actually cause security alerts with applets even if you set security settings to absolute minimum (had it many times with my applet). I guess it is a school/study work (as it is an applet), so it is probably worth trying to run it directly by appletviewer.

Categories : Java

Google Apps Engine, Sending out Emails Receiving this Error (Attempt to access a blocked recipient without permission.) Java
This is not a definitive answer ... The exception message says this: Could not connect to SMTP host: localhost, port: 25 (java.net.SocketException: Permission denied: Attempt to access a blocked recipient without permission.)) So the transport is attempting to use an SMTP service running on the same machine as the GAE. But the error message seems to indicate that it succeeding in connecting, and the SMTP service refused to accept the email for delivery to any of the recipients. So I would suggest that you do the following: Try it out with a real email addresses not "xxx@example.com" addresses. Check the configurations for your local MTA service (whatever it is) to see if it is configured to relay email to external addresses. Check the MTA log files. There should

Categories : Java

Is it possible to add PHP scripts in a Java server?
you can execute external programs from your java code you will have to pass the data back and forth somehow. reading/writing stdin and stdout probably maby this will help: Execute external program in java

Categories : Java

onchange combobox and java scripts
Changing <table> display to "inline" is not a good idea and indeed will cause weird behavior. Better change to empty string which will take the default: document.getElementById('auth_method_pr1').style.display = ""; That said, your code can be written somewhat different to be more readable and somewhat better. First, send the drop down object to the function: <select name="nb_shetab_bank" size="1" onchange="bank_state(this);" > Now the function can look like this instead: function bank_state(sender) { var table1 = document.getElementById('auth_method_pr1'); var table2 = document.getElementById('auth_method_pr2'); switch (sender.value) { case 'SAMAN': table1.style.display = ''; table2.style.display = 'none'; break;

Categories : Javascript

Rewriting functions in java scripts
You can use this idiom to initialize a LUT on the first call like this var getBase32Value = function (dummy) { var base32Lut = {}; var alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; for(var i=0; i<alphabet.length; i+=1) { base32Lut[ alphabet[i] ] = i; } getBase32Value = function (v) { return base32Lut[ v ]; } return base32Lut[ dummy ]; }

Categories : Javascript

In Rails, how should we get parameters in java scripts?
You can directly output the value in the javascript part: <script type="text/javascript"> var width = <%= width %>; </script> The code in Ruby/Rails will be interpreted during the rendering, and will output the (ruby) variable width inside the generated HTML.

Categories : Javascript

java scripts : events configurable
Exactly what you want is not possible: var events_list = mousedown,mousemove,scroll In your example mousedown, mousemove and scroll will be considered variables and will throw an error because they are not declared. You can make them configurable as a list of elements in a string separed by comma: var events_list = "mousedown,mousemove,scroll"; Then split them into an array and loop through it: function Init () { var events_list = "mousedown,mousemove,scroll"; if (document.addEventListener) { events_list.split(',').forEach(function (eventName) { document.addEventListener(eventName, function () { ChangeState(); }, false); }); } }

Categories : Javascript

make HTML generated by content scripts of extensions inaccessible to page scripts
There aren't any special Chrome Extension techniques for this. As you'll read here, JavaScript injected via a content script is automatically sandboxed, or separated from the JavaScript on a web page, but this is not the case for HTML -- the DOM elements are shared between the page scripts and the injected content scripts.

Categories : Javascript

display charts using java scripts in android
RGraph uses the HTML5 Canvas component, which is NOT accommodated in the webkit packaged with Android 1.5. RGraph works nicely & tested with Android 2.1 and 2.2. Example of the HTML/Javascript approach: Calendar using Epoch 3D-Rotating cube uses HTML/Javascript

Categories : Javascript

Calling Scripts from Java through SFTP Connection
just Runtime.getRuntime().exec("cmd /c start Hello.bat") works for me. Also see How do I run a batch file from my Java Application? Make a small change in batch file to keep command prompt open @echo off echo "Hello World" PAUSE so your java code is fine you just need to modify batch file to keep command prompt open when program is run successfully.

Categories : Java

Transfering data between Lua scripts and Java application with LuaJava
There's a reference manual here: http://www.keplerproject.org/luajava/manual.html. The Java documentation is at the bottom. Here's an example (although it might be a bit out-dated): http://lua-users.org/lists/lua-l/2003-12/msg00286.html You might want to start with understanding the C interface to Lua. The LuaJava interface is built on that. The basic idea is that you have a stack and you first push the function, followed by arguments, and then you can execute a function in Lua. The results are then pushed on the stack and you can get data back from Lua that way.

Categories : Java

Executing several perl scripts at different times in one java program
If all the parameters of your ProcessBuilder are always the same (i.e. you always call the same script with the same arguments), you can use the same ProcessBuilder in all your threads and only need to make sure that it is properly published to those threads. Typically, if you start your threads after having created and setup the ProcessBuilder you will be fine. If however different threads need to make changes to the ProcessBuilder (or if you make changes to the builder after the threads have been started), you will need to synchronize those changes - cf the javadoc: Note that this class is not synchronized. If multiple threads access a ProcessBuilder instance concurrently, and at least one of the threads modifies one of the attributes structurally, it must be synchronized external

Categories : Java

Status of perl scripts run from bash scripts
Perl scripts behave the same when run from the shell. Having test.pl: #!/usr/bin/env perl exit(0); # or just exit running: ./test.pl && echo "OK" || echo $? OK Having #!/usr/bin/env perl exit(123); running: ./test.pl && echo "OK" || echo $? 123 Having #!/usr/bin/env perl die; running: ./test.pl && echo "OK" || echo $? Died at ./test.pl line 2. 255 So: Exiting from perl script with 0 (or nothing) will be true in shell. Exiting from perl script with a (byte) value other than 0 will be false in shell and $? will give you the exit value. Exiting from perl script with die will be false in shell and $? will be 255 (in my case - I checked it).

Categories : Linux

How to use python script to start other python scripts and check whether all "child scripts" are finished?
Try swapping the location of r.wait() and po.close() if __name__=="__main__": for dirpath, dirname , filenames in os.walk(rootdir): for filename in filenames: if filename=='Test.py': argument.append( [ dirpath, filename ] ) print argument po=multiprocessing.Pool() r=po.map_async(Openpy, argument) r.wait() po.close() It might not be your problem, but it looks like maybe you are closing the pool before the result is evaluated.

Categories : Python

java scripts on my website running locally but not running on server
Uncaught SyntaxError: Unexpected end of input jquery.js:6 Uncaught ReferenceError: jQuery is not defined Check if you uploaded jQuery correctly. The file might have been truncated in the process. UPDATE Checking your jQuery file, the file truncates on line 6 with these as the last few characters. if(this[0]){var b=f(a,this[0].owne SOLUTION Re-upload the jQuery file (jquery.js) again, or Use jQuery CDN: Change: <script src='http://www.broadigital.co.ke/style/newcss/js/jquery.js?ver=1.7.2' type='text/javascript'></script> To: <script src='http://code.jquery.com/jquery-1.7.2.min.js' type='text/javascript'></script>

Categories : Javascript

Calling java script chrome and firefox
Caching? Try this instead of your tag: <script type="text/javascript"> var cacheBuster = new Date().getTime(); var s = '<script src="../../../data/novus/src/models/multiChart.js?_=' + cacheBuster + '"></script>'; document.write(s); </script>

Categories : Javascript

How to find Chrome download path in Java
Google chrome is maintaining one config file for such custom configuration Named as Preferences which is in JSON format.So you have to read this file.You will get the current path of download folder from this file. "download": { "default_directory": "CURRENT_PATH_OF_YOUR_DOWNLOAD_FOLDER", "directory_upgrade": true, "extensions_to_open": "", "prompt_for_download": false }, Parsing JSON File Java This will help you to read that file. Location of this configuration file In Linux is /USER_HOME_FOLDER/.config/chromium/Default/Preferences and in Windows is C:UsersUSER_ACCOUNTAppDataLocalGoogleChromeUser DataDefaultPreferences

Categories : Java

Url working in Google chrome inaccessible by Java w/Jsoup?
If you use Jsoup you have to replace spaces with %20 and not with +. Try this url : https://www.google.com/search?q=definition%20of%20apple String url = "https://www.google.com/search?q=definition%20of%20"; url += search; //search is the passed in string Document doc = Jsoup.connect(url).get();

Categories : Java

java.lang.NullPointerException when running a testcase via Selenium webDriver in Chrome
Your trouble come from your try/catch and specially your finally. Because your driver is only localy in your try{} so... your finally can't do something with your driver. I'll rename your drivers to help you to see what happens here. public class Test_Chromedriver { public static WebDriver driverNULL; // <- never instantiate public static void main(String[] args) { try { System.setProperty("webdriver.chrome.driver","E:\jars\chromedriver.exe"); WebDriver driverOK=new ChromeDriver(); // < - local variable driverOK.get("http://www.facebook.com"); driverOK.findElement(By.id("email")).sendKeys("surya"); driverOK.findElement(By.name("pass")).sendKeys("hello"); } catch (Exception e) { e.printSt

Categories : Java

SelectorImpl is BLOCKED
If you can elaborate more on what your Netty is doing it could be helpful. Regardless - please make sure you are closing the channels. Notice from the Channel javadoc: It is important to call close() or close(ChannelPromise) to release all resources once you are done with the Channel. This ensures all resources are released in a proper way, i.e. filehandles If you are closing the channels, then the problem may be with the logic it self - running into infinite loops or similar - which may be able to explain the high CPU.

Categories : Java

Firefox blocked the ads
Add an exception in your ad blocker. While on your page, click on the icon of your ad-blocking extension (there should be one somewhere), and add your domain to the whitelist (ex add "librax.net*" to the whitelist), or click a button like "Don't block ads on this page". This would depend of the firefox addon you use.

Categories : HTML

PHP exec is blocked by ISP
Is there an alternative way to do this ? There also are system and shell_exec, but I'd assume this to be disabled for the same reasons. Like pointed out in the comments, you could also just provide your server's static IP instead of having the script determine it. However, chances are sockets are disabled as well, so don't put your hopes too high. Do all Isp's block this ? Most Hosting Providers do. Obviously a hosting service doesn't want you to run arbitrary commands on the shell that could potentially reconfigure the machine. What can I do? Get paid hosting that allows you to exec. A VPS or a dedicated server comes to mind.

Categories : PHP

java script form validation works fine in chrome but not working in firefox?
try this code it is working in firefox also validation code in javascript for email validation http://informationiswelth.blogspot.in/

Categories : Javascript

Invoking a Java web service from JavaScript: Uncaught SyntaxError: Unexpected token < in Chrome
You should specify only a single dataType. Right now, you seem to have listed all possible types. Also, you specified contentType: "application/xml; charset=utf-8", but you are not sending any data with the request. Finally, you have specified an absolute URL potentially violating the same origin policy restriction (you cannot send cross domain Ajax requests). So after taking those remarks into account you may try: <script type="text/javascript"> function CallService() { $.ajax({ type: "GET", url: "/TestWS/services/HelloWorld/getName", success: Success, error: Error }); } function Success(data, status) { alert(data); } function Error(request, status, error) { alert(error); } &

Categories : Javascript

why the agent is blocked for my code?
I think the problem is with this line: (def total (apply + result)) It should be: (def total (apply + @result)) It wasn't actually blocking, it was throwing an exception. One more note: you should consider using recur in doin3, instead of direct call, as it's in a tail position already.

Categories : Clojure

.js file being blocked by all browsers
I get a warning message that content unsecure content is being blocked. You seem to be on a secure (HTTPS) site and loading your scripts via HTTP. All ressources need to be loaded with a secure connection otherwise the page would be corrupted.

Categories : Javascript

semaphore p3 blocked forever?
you are right - deadlock - nothing printed. at deadlock: p3 is waiting at second P(C). either p1 or p2 has done its first iteration, the other - zero iteration. both p1 and p2 is waiting at P(A). value of d depends on race between p1 and p2 - which entered first iteration.

Categories : Misc



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.