Checking a Url in Jquery/Javascript

That isn’t how AJAX works. AJAX is fundamentally asynchronous (that’s actually what the first ‘A’ stands for), which means rather than you call a function and it returns a value, instead you call a function and pass in a callback, and that callback will be called with the value. (See http://en.wikipedia.org/wiki/Continuation_passing_style.) What do you want … Read more

CSS background image URL failing to load

You are using a local path. Is that really what you want? If it is, you need to use the file:/// prefix: file:///H:/media/css/static/img/sprites/buttons-v3-10.png obviously, this will work only on your local computer. Also, in many modern browsers, this works only if the page itself is also on a local file path. Addressing local files from … Read more

Does VBA have any built in URL decoding?

Here’s a snippet I wrote years ago -markus Public Function URLDecode(sEncodedURL As String) As String On Error GoTo Catch Dim iLoop As Integer Dim sRtn As String Dim sTmp As String If Len(sEncodedURL) > 0 Then ‘ Loop through each char For iLoop = 1 To Len(sEncodedURL) sTmp = Mid(sEncodedURL, iLoop, 1) sTmp = Replace(sTmp, … Read more

How do I apply URL normalization rules in PHP?

The Pear Net_URL2 library looks like it’ll do at least part of what you want. It’ll remove dot segments, fix capitalization and get rid of the default port: include(“Net/URL2.php”); $url = new Net_URL2(‘HTTP://example.com:80/a/../b/c’); print $url->getNormalizedURL(); emits: http://example.com/b/c I doubt there’s a general purpose mechanism for adding trailing slashes to directories because you need a way … Read more

Extract keyword from Google search in Javascript

You don’t need a regular expression for this. Modified from http://jquery-howto.blogspot.com/2009/09/get-url-parameters-values-with-jquery.html: function getUrlVars(href) { var vars = [], hash; var hashes = href.slice(href.indexOf(‘?’) + 1).split(‘&’); for(var i = 0; i < hashes.length; i++) { hash = hashes[i].split(‘=’); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; } You can then do this: var v = getUrlVars(“http://www.google.com/webhp?hl=en#sclient=psy&hl=en&site=webhp&source=hp&q=car&aq”); var … Read more

Android webview loadDataWithBaseURL how load images from assets?

try like this WebView webview = (WebView)this.findViewById(R.id.webview); String html = “<html><head><title>TITLE!!!</title></head>”; html += “<body><h1>Image?</h1><img src=\”icon.png\” /></body></html>”; webview.loadDataWithBaseURL(“file:///android_res/drawable/”, html, “text/html”, “UTF-8”, null); For more information try this link perfect LoadDataWithBaseurl