w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
JQuery links to open new window
Alternatively use e.preventDefault() or return false $(document).ready(function(){ $(".playSong").click(function(e){ e.preventDefault(); // this will prevent the browser to redirect to the href // if js is disabled nothing should change and the link will work normally var url = $(this).attr('href'); var windowName = $(this).attr('id'); window.open(url, windowName, "height=300,width=400"); }); });

Categories : Javascript

Open links with keyboard keys via jquery
You're missing the "break" statements in your switch statement. Try this: $(window).keydown(function(e) { switch (e.keyCode) { case 37: case 38: window.open ('link1.html','_self',false); break; case 39: case 40: window.open ('link2.html','_self',false); break; } return; }); For reference: http://www.w3schools.com/js/js_switch.asp

Categories : Jquery

How can I disallow WebView to open links on the browser in WinRT( target=_blank links )?
There is a navigation starting event. It have a cancel property that can be used to cancel the navigation. Maybe this will work for you? http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.webview.navigationstarting

Categories : C#

Calling External Dynamic Links from VBulletin > Need Links to Open in Base Target iFrame
Asuming all of this is on the same domain, and that your target iframe had an id like <iframe id="openlinkshere"> You could add a handler on your links like this: <script type="text/javascript" src="http://[VBulletin]/external.php?forumids=1&type=js"> </script> <script language="" type="text/javascript"> <!-- for (x = 0; x < 5; x++) { document.writeln("<a onclick="top.document.getElementById('openlinkshere').location.href = this.href; return false;" href="http://[VBulletin]/showthread.php?t=" +threads[x].threadid+"">"+threads[x].title+"</a> (Posted By: "+threads[x].poster+")<br />"); } </script> This would open the link on your target iframe top.document.getElementById('openlinkshere').location.href = this.href; This stops

Categories : Javascript

CasperJS - How to open up all links in an array of links
Try something like this. var x; casper.start(URL, function() { x = links.split(" "); // now x is an array of links }); casper.then(function() { this.eachThen(x, function(response) { this.thenOpen((partialURL + response.data), function() { this.echo(this.getTitle()); // display the title of page }); }); }); casper.run(); x was undefined because the for loop was being executed before casper.start. In the above code, the eachThen() block is nested inside of a casper.then block in order to delay its execution.

Categories : Javascript

Open a New Jquery UI Dialog With Links in Existing Dialog
Actually this is possible and I just did it a few days ago. Can you make sure your click event is bind correctly in your dialog? Maybe put an alert on click and see if it actually works? Is this where you are opening the new dialog? $("#home-tos").click(function( event ) { event.preventDefault(); $("#tos-description").dialog("open").load("/tos/"); return false; }); Can you just test something like this: $("#home-tos").live("click", function() { alert("click worked"); }); There's also an open method of dialog, where you could do this: $("dialog-div").dialog({ autoOpen: false, open: function() { $(this).find("yourbutton")click(function() { alert("click worked"); }); } }); jsfiddle:

Categories : Javascript

Links to open apps in iOS
The apps would need to have a custom URL scheme registered in their info.plist. I believe the following site will help you find what you are looking for: http://handleopenurl.com/

Categories : HTML

External links in phonegap app do not open well
I would start by asking : in the file config.xml the preference stay-in-webview is deprecated now for phonegap 2.3.0 right? So nothing to hope here? That's correct. Dont even worry about this setting if you are using 2.9 I read and try a lot about the plugin InAppBrowser with window.open and target system / blank / self but no differences for me. I stay InApp but useless because no navigation buttons. Am I missing something here? I had a few issues getting this to work as well. Their documentation is a bit scattered and need to read it all. Here is how I get it working: Ensure you have <script src="phonegap.js"></script> in each of your pages that wants to use the inappbrowser You should NOT need to include a plug-in tag in your config.xml. I am pretty sure that a

Categories : Cordova

links within an iframe window to open in new tab
//pass the iframe to this iframe getting function function iframeRef( frameRef ) { return frameRef.contentWindow ? frameRef.contentWindow.document : frameRef.contentDocument } //Get Iframe var inside = iframeRef( document.getElementById('iframeID') ); //Get all links var links = inside.getElementsByTagName('a'); //Loop throught links and set their attributes for (var i = 0 ; i<links.length ; i++){ links[i].setAttribute('target','_blank'); } //No jQuery needed! thanks to meder EDIT Due to iframe same source restrictions I had to find a website with inner iframe from same source so you can paste this code //pass the iframe to this iframe getting function function iframeRef( frameRef ) { return frameRef.contentWindow ? frameRef.content

Categories : Javascript

Tabs open according to links on sub menu
You can do this using Javascript. Just toggle property display of that class from none to block and vice versa. If you are using jQuery, you can do this: $(document).ready(function() { $('#cat_link').click(function() { $('#tabs-1').hide(); $('#tabs-2').show(); return false; }); $('#item_link').click(function() { $('#tabs-2').hide(); $('#tabs-1').show(); return false; }); }); You also have jQuery-UI widget tabs. If you are using pure javascript, you can do it like this (reference): function hideshow(which){ if (!document.getElementById) return if (which.style.visibility=="visible") which.style.display="hidden" else which.style.display="visible" }

Categories : HTML

Python open a link into links
Simply iterate through each of the original links, printing out all of the children links. import urllib2 import re htmlfile = urllib2.urlopen('http://www.kino.de/rss/neu-im-kino/') htmltext = htmlfile.read() regex = '<link>(.+?)</link>' pattern = re.compile(regex) links = re.findall(pattern,htmltext) print( ' '.join(links) ) # or print( ' '.join(links) ) for link in links: htmlfile_2 = urllib2.urlopen(link) htmltext_2 = htmlfile_2.read() regex_2 = '<meta itemprop="contentURL" content="(.+?)" />' pattern_2 = re.compile(regex_2) links_2 = re.findall(pattern_2,htmltext_2) print( ' '.join(links_2) ) # or print( ' '.join(links_2) )

Categories : Python

Make My App Able To Open Web Links (So it can be set as default by user)
You need to register intent filter scheme "http" http://developer.android.com/guide/topics/manifest/data-element.html Here is an example http://androidsmith.com/2011/07/launching-an-android-application-from-a-url/

Categories : Android

How to open links in a python console application
Since you're using Windows, you can use Windows console functions to detect clicks on the console, translate the click positions (which will already be character positions) to links via hit-testing, and hook them up to e.g. webbrowser.open to open a link. Input handling for console applications is described here: http://msdn.microsoft.com/en-us/library/windows/desktop/ms682079%28v=vs.85%29.aspx.

Categories : Python

WebBrowser control doesn't open links
I found this link. I'm still testing for bug issues and stuff myself, So I can only provide you this information. :)

Categories : Wpf

Having url links open in anew, named window
Basically, you want to open all of your links 1 particular frame. Try this... function callme(event) { event.preventDefault(); document.frames["frame"].location = $(this).attr('href'); } markup: <a href="http://google.com" target="frame" onclick="callme.call(this,event)"> Link </a> <a href="http://yahoo.com" target="frame" onclick="callme.call(this,event)"> Link </a> Try this: jsFiddle

Categories : HTML

Phonegap open external links outside App from a Whitelist URL
There is a config.xml setting that will do the trick: <preference name="stay-in-webview" value="true" /> Or, you can use _system if you include the InAppBrowser plugin. <a href="#" onclick="window.open('http://www.nhl.com', '_system', 'location=yes');">_system</a> InAppBrowser API Doc Here's a couple related threads: https://build.phonegap.com/docs/config-xml (page search for "stay-in-webview") PhoneGap Build: how to open external url in device browser on Android?

Categories : Javascript

How to Open iTunes Links inside Chrome for iOS?
Je pense que ton lien n'est pas le bon :/ essaye donc ça: (I think you're using a wrong link, try this:) http://itunes.apple.com/fr/linkmaker/ That can be helpful too: https://developers.google.com/chrome/mobile/docs/ios-links

Categories : Iphone

How to open Google Maps links in a pop up window?
Both of those links have target="_blank" on them, so normally they should open in a new window automatically. For example the Google Maps link looks like this: <a target="_blank" href="http://maps.google.com/maps?..." title="Click to see this area on Google Maps" style="position: static; overflow: visible; float: none; display: inline;" > <div ...> <img ...> </div> </a> But it looks like PhoneGap is overriding that behavior as you mentioned in the comment. In fact if you search for: phonegap target _blank you will find quite a bit on the topic, in particular this discussion and this issue. It looks like they want people to use PhoneGap's InAppBrowser, but it appears to be tied specifically into the window.open() function. So you

Categories : Javascript

Open external links in the browser with android webview
The problem is you need to send an Intent to the default web browser to open the link. What you are doing is just calling a different method in your Webview to handle the link. Whenever you want another app to handle something you need to use Intents. Try this code instead. private class CustomWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if(url.contains("message2space.es.vu")) { view.loadUrl(url); } else { Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); startActivity(i); } return true; } }

Categories : Android

Selectively open links in mobile browser and App using shouldOverrideUrlLoading?
your initital thoughts are correct. in fact, I beleive shouldOverrideUrlLoading() is a part of the API for doing exactly that. open the url in the app = super.shouldOverrideUrlLoading(); mYourWebViewInstance.loadUrl(url); return true; open the url in the mobile browser = Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url )); startActivity(browserIntent); return true; this code will launch directly app that can handle this data type, which be in this case any browser app installed on your device, or will give you intent chooser to select one of your browsers to show the url if you have more then one web browsers installed and none of them set to be default (always open with...) returning true according to the documentation means you handled the url yourself, and

Categories : Android

Excel links not working unless source workbook is open?
You can't use names to reference ranges in closed workbooks. I would guess (without seeing the book) that you could replace your named references with whole-column / whole-row references (as the match won't trigger on blanks). This would solve your need and wouldn't cause speed problems. HTH

Categories : Excel

Cannot open anchor links pointing to file in Chrome
Did you try using forward slashes instead. I mean instead of <a href="\Prdhilfs03l&amp;i-sales&amp;mktWORKAREAAgencyservicesSharedAICMasterListAttachmentsAF.xls" class="noLine"></a> to use <a href="//Prdhilfs03/l&amp;i-sales&amp;mkt/WORKAREA/Agencyservices/Shared/AIC/MasterListAttachments/AF.xls" class="noLine"></a> Convert the urls: var links = document.querySelectorAll("a"); for(var i=0; i<links.length; i++) { var link = links[i]; var url = link.getAttribute("href"); if(url) { url = url.replace(/\/g, "/"); link.setAttribute("href", url); } }

Categories : Javascript

Phonegap 2.9.0 doesn't open external links in default browser
I also encountered this problem. Seems most answered are exactly opposite to the question, people usually answer how to open in inAppBrowser, I don't know why. Just like you I tried various of methods but no one work. Finally I have to turn to native way. Fortunately, native way took my only around no more than 10 minutes that is much shorter than try people's phonegap answers. In Android, add the line in onCreate method to bind object to webpage's window object. add a method on your binded object which accept a url string and behave open browser behavior. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.appView.addJavascriptInterface(this, "nativeInterface"); } public void openInDeviceBrowser(String url) { Intent i =

Categories : Cordova

How can I force links to files trigger download in the browser (and not open)
As far as I know it is not possible by just setting some special string to the href property of an <a> tag. But you can get your desired behaviour by replacing the link by an asp.net linkbutton and a postback in which you call the following method: public static void DownloadFile(string filename, string path) { Response.ContentType = "application/unknown"; Response.AppendHeader("Content-Disposition", "attachment; filename=" + filename); Response.TransmitFile(path); Response.End(); } path is the full path to the file you want to send to the client and filename is the name which the file should have when it is sent (can be different from the original name).

Categories : C#

Creating web links that will open a website, iOS, Android or Win8 app depending on device
Rather delayed reply but here goes: Detect which OS is being used using Javascript code. Link Change the hyperlink based on whether it is an iPhone Android or Windows. If its iPhone use this, if its Android use this and for Windows use this Hope that helped!

Categories : Android

SAS- Auto Login to a secure website , open links in it and fetch data
The correct way to login to a secure site is given in the documentation : filename foo url 'https://www.b.com/file1.html' user='jones' prompt; If you're having trouble with that with the error above, it's possible you have a malconfigured SAS installation or OS. See this reference, in particular the SSLCERT options in section 2, for more specific details useful for your site.

Categories : Security

Android - Open target _blank links in WebView with external browser
I also have the same problem and now I've found the solution. You also need to use WebChromeClient.You can see this and this . And you can set a WebViewClient to the new WebView and override the shouldOverrideUrlLoading method, then you can get the url and do whatever you want here. If you don't set the WebViewClient, I think it should works too. In my case I want to get the url so I set a WebViewClient to the new WebView. By the way, if you remove the old webview then when you come back form the browser,the webview is blank. So I retained the webview and added a new one but set the visibility to "gone".

Categories : Android

HTML5 Android App loaded via WebView, Identify links to open in app vs in Browser
For specific links that you want to open in your app- make them with specific pattern or from specific host, then in your Manifest file, put this code in your activity: <intent-filter> <action android:name="android.intent.action.VIEW"></action> <category android:name="android.intent.category.DEFAULT"></category> <category android:name="android.intent.category.BROWSABLE"></category> <data android:host="yourhost" android:scheme="http"></data> </intent-filter> the problem is that android will give the user the option to choose where to open this link (in the browser or in your app), and I'm afraid it's not what you want to do.

Categories : Android

HtmlUnit failing when it tries to open dead javascript links. Is there a way to tell it not to load specific URLs?
A brief look at the HtmlUnit JavaDoc seems to indicate that you should be able to use WebClientOptions#setExceptionOnFailingStatusCode(boolean) e.g., import com.gargoylesoftware.htmlunit.WebClient import com.gargoylesoftware.htmlunit.BrowserVersion import com.gargoylesoftware.htmlunit.html.HtmlPage object ScrapeTest { def main(args: Array[String]): Unit = { val pageurl = "http://www.eci-polldaymonitoring.nic.in/psl/" val client = new WebClient(BrowserVersion.INTERNET_EXPLORER_8) // Don't throw exception on failing status code client.getOptions.setExceptionOnFailingStatusCode(false) var response: HtmlPage = client.getPage(pageurl) println(response.asText()) } } If that doesn't work you could also try: WebClientOptions#setJavaScriptEnabled(boolean) WebCl

Categories : Java

Jquery not to open popups in hover with window.open and mousenter
What are you trying to do is not possible, you are trying to bind 2 different events, however if you are going to click the mouse will have to hover it first, you can't avoid that, I suggest reevaluating your strategy, maybe adding a different link to trigger your pop up or changing classes and triggering different events depending on which class is hovered or clicked.

Categories : Jquery

A Comprehensive Regular Expression to find URL, links,page links, website links from HTML Page or String
Have a look here http://regexlib.com/Search.aspx?k=URL&AspxAutoDetectCookieSupport=1 You can find a lot of examples and patterns there and there are a lot of general Regex tutorials and articles. After a quick browse I found this : ([dw-.]+?.(a[cdefgilmnoqrstuwz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvxyz]|d[ejkmnoz]|e[ceghrst]|f[ijkmnor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eouw]|s[abcdeghijklmnortuvyz]|t[cdfghjkmnoprtvwz]|u[augkmsyz]|v[aceginu]|w[fs]|y[etu]|z[amw]|aero|arpa|biz|com|coop|edu|info|int|gov|mil|museum|name|net|org|pro)(|W(?<!&|=)(?!.s|.{3}).*?))(s|$) Should do the trick, but I'm sure there are more elegant examples on that list.

Categories : C#

Jquery hide open divs before open a new one
Try changing your jquery to this: jQuery(function ($) { $('.list-op').click(function () { var itemid = '#div' + $(this).attr('target'); //id of the element to show/hide. // this is already shown var stop = $(itemid).hasClass('aktiv') $('.aktiv').slideToggle("slow").removeClass('aktiv'); if(stop) return; $(itemid).slideToggle("slow").addClass('aktiv'); }) });

Categories : Jquery

window.open using JQuery wont open a JSP in a pop-up
To "make sure that strUrl location is right", open a new window or tab in your browser, paste http://localhost:8085/reports/popupData.jsp in the address bar and hit Enter. If you can navigate to the page manually, then strUrl is correct. You may be running into browser security issues, or pop-up blockers, as you are dealing with pop-up windows. A larger issue is that, with modern browsers, you cannot programmatically control whether your pop-up is opened in a new window or a new tab. This is left completely up to the control of the user. The good news is that you've tagged this question as jQueryUI, so you have access to the jQuery UI Dialog widget. A simple change to your existing markup: <input type="button" id="showLanguage" value="OPEN" /> <div id="dlg"></div> an

Categories : Javascript

how do you make a text input field open different links based on user input
Pseudocode: function parmatch(input): if input matches /^bbb$/ open 'http://example1.com/{input}' return if input matches /zzz/ open 'http://example2.com/something-predefined{input}' return if input matches /xxx/ open 'http://example3.com/something-predefined{input}' return MDN's article on regular expressions in JavaScript

Categories : Javascript

How to use a javascript Randomizer script to link into an iframe so that i can open from a list of links in the script
If I understand correctly, you want to load the URL in an iframe, and show the chosen URL somewhere on the website. Change your function to: <script type="text/javascript"> var url=[ 'http://www.fallingfalling.com', 'http://www.omfgdogs.com', ]; window.onload=function() { var theURL = url[Math.floor(Math.random()*url.length)]; document.getElementById('trig').onclick=function() { location.href=theURL; }} document.getElementById('chosenURL').innerHTML = '<a href="'+theURL+'">'+theURL+'</a>'; </script> Then add this HTML to your page, there where you want the text: <div id="chosenURL"></div>

Categories : Javascript

How to open links in default browser inside InApp Browser on PhoneGap
I have been using this as a workaround (opening an inappbrowser instance): // Image zoom $('#container').on('tap', '#content.cmscontent img', function() { var browser = window.open((navigator.userAgent.indexOf('Android') != -1 ? 'file:///android_asset/www/' : '') + encodeURI($(this).attr('src')), '_blank', 'location=no,toolbar=yes,enableViewportScale=yes,transitionstyle=crossdissolve'); }); See I added (navigator.userAgent.indexOf('Android') != -1 ? 'file:///android_asset/www/' : '') as a prefix before the url. Now it detects when you're app is on Android and adds the local URL in front of it.

Categories : Android

How to open workbook that contains automatic links to information in another workbook in UIWebview or QLPreviewController
I don't believe QLPreviewController supports the newer Microsoft formats (*.docx , *.xlsx). And especially they do not work with links to other documents. If you wanted to accomplish something like this, sadly you are limited to using local HTML files shown in a web view instead.

Categories : Objective C

Replace Page Links on Popup Page With Javascript to Open in Main (Parent) Window
You cant replace attribute target, from attribute href. use el.target and just set the value var aEls = document.getElementsByTagName('a'); for (var i = 0, aEl; aEl = aEls[i]; i++) { aEl.target="_parent"; }

Categories : Javascript

Jquery animate links
You need to include JQueryUI in your project. Here is an example : http://jsfiddle.net/UQTY2/142/ Also, do not use same ID for more than 1 element. <div class="main_body"> <div class="nav1"><a href="http://www.google.com">Test1</a> </div> <div class="nav1"><a href="http://www.google.com">Test2</a> </div> <div class="nav1"><a href="http://www.google.com">Test3</a> </div> <div class="nav1"><a href="http://www.google.com">Test4</a> </div> </div> $(document).ready(function () { $("a").animate({ color: 'green' }, 2000) });

Categories : Jquery

jQuery Datatable row links
For sending data back to the controller you should use an ajax call. $.ajax({ url: "@(Url.Action("Action", "Controller"))", type: "POST", cache: false, async: true, data: { id: 'id' }, success: function (result) { (do something) } }); you can pass multiple fields through data as data: 'data, data1: 'data1', etc

Categories : C#



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