w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Making sure elements changed by javascript remain changed when user returns to page without refreshing
Unfortunately, there's no real good answer to this one. The back button generally returns to a version of the page cached on the users browser, and interacts poorly with many forms of dynamic content. You might consider trying to convince your users not to use the back button (made easier by a robust navigation bar or equivalent that they can use instead) or putting in a helpful note. There are also various meta-tages you can put in to tell the browser not to cache the page (thus causing them to load it fully every time), but this can slow things down, and may not be followed by all browsers.

Categories : Javascript

Css class name getting changed in html of aspx page
class="menu ct100..." means that this element has two classes 1:menu and 2:ct100... and nothing is wrong with it!the ct100... is generated by asp.net and if it is different any time you run the page it's up to asp.net component and if you dont like that try not to use this built in component, that i think you should do it. by the way the only thing is changing when using master pages is client side id, that you can avoid this from happening by code below <asp:TextBox ID="myId" runat="server" ClientIDMode="Static"></asp:TextBox> set ClientIDMode to Static

Categories : HTML

XML data file has been changed, but changes don't appear on html page in gmaps
Most likely a caching issue. If you don't tell the browser the file has changed, it won't update until your refresh the page (or sometimes in some browsers clear out the cache), sometimes loading the updated XML in the browser will work.

Categories : Javascript

pass a javascript variable within a html page into a html form (on the same page) for submission to perl cgi
Add a hidden field. Set the value in that field to the value of the variable in Javascript. <form action="cgi-bin/runalg.cgi" method="post" enctype="multipart/form-data"> [...] <input type="hidden" name="ID" value="default"> </form> And then on javascript: <script type="text/javascript"> document.forms[0].elements["ID"].value = getValue("ID"); </script> The index for the form may vary in your document.

Categories : Javascript

URL of Category page in Magento changed to /shop-3.html how to change it back to /shop.html
you can edit url write,i think there will be entry like /shop-3.html just change it is you want http://www.magentocommerce.com/wiki/modules_reference/english/mage_adminhtml/urlrewrite/index and also refer http://www.magentocommerce.com/knowledge-base/entry/what-url-rewrites-are-and-why-they-are-important hope this will sure help you.

Categories : HTML

Get the changed HTML content after it's updated by Javascript? (htmlunit)
I figured it out! HtmlPage objects have an executeJavaScript(String) which can be used to kick off the showTime script. Then, once the script has actually started, that's when waitForBackgroundJavaScript becomes relevant. The code I ended up with: import com.gargoylesoftware.htmlunit._ import com.gargoylesoftware.htmlunit.html.HtmlPage import com.gargoylesoftware.htmlunit.html.DomElement object AtomicTime { def main(args: Array[String]): Unit = { val url = "http://tycho.usno.navy.mil/what.html" val client = new WebClient(BrowserVersion.CHROME) var response: HtmlPage = client.getPage(url) response.executeJavaScript("showTime") printf("Current AtomicTime: %s", getUpdatedRespose(response, client)) } def getUpdatedRespose(page: HtmlPage, client: WebClient):

Categories : Java

Updating html code with javascript when php return changed
The problem with calling an asynchronous function using setInterval is that the unanswered requests might accumulate if the server or the network is slow. Here's how you might do it : (function doOne(){ $.get('returnfunction.php', function(data) { test=data; document.getElementById('t1').innerHTML=test; setTimeout(doOne, 1000); }); })(); This way the next call to $.get occurs one second after the server has answered the last call. You might also want to act on failures, not just on success, depending on your exact requirements.

Categories : PHP

Chrome Extension Javascript/jQuery load page and check if changed
So you're doing a lazy load of content in a div, and you want to know when that div has loaded? Depending how you're doing it, you'd be better to set a flag and react to the AJAX "load" event associated with that lazy load. If you must do it the way you suggest, try this: Create an interval (setInterval) that checks the load status, or the contents of the div if false, do nothing. If true, clearInterval.

Categories : Javascript

TotalResults count changed when page index changed FullTextQuery in sharepoint search
the problem is caused by the paging web part. If you modify it to show all the pages, the statistic total results number will be always the same. For example, from the paging web part properties, change the number of pages before and after current page to 1000, then you will see that your problem will not exist anymore!! This is a bit ugly if you have many pages!!! Check out this: http://kamilmka.wordpress.com/2012/04/14/customize-sharepoint-search-results-paging/

Categories : Sharepoint

Source File Changed But Page is not Changed
Did you try clearing browser cache yet? Here is how to clear cache. For development purpose, you can disable caching in chrome as shown here.

Categories : Misc

Getting access to the protected page when shouldn't
CURL will ignore the header directive and move on if the script doesn't stop at that stage. Return a 403 forbidden as an else clause and die() or exit() immediately afterwards, after failing the isLoggedIn check and CURL will no longer get access.

Categories : PHP

Passing value input by user to another html page using javascript and redirect using javascript function
For this kind of stuff you have to use a server-side language (PHP, ASP, etc.) as you can pass variables thru files and so forth. Doing this with HTML/JS only is going to get you in trouble as you are basically giving the user, pass and id to anyone openly. Have a look here: PHP Codecademy.com

Categories : Javascript

HTML/JQuery: Button submits once when it shouldn't at all
You want to use jQuery ajax call like so: $(document).on('click','button#signbtn', function(){ var $form = $('form#signform'); var url = $form.attr('action'); $.ajax({ type: "POST", enctype: 'mutipart/form-data', url: url, data: $form.serialize(), // serializes the form's elements. success: function(data){// whatever you want your code to do on success} }) return false; // avoid to execute the actual submit of the form. });

Categories : Javascript

Using OnClientClick and onClick Shouldn't Refresh the Page
You need to return false from delayer function, and also add return to OnClientClick event. <asp:Button ID="Button3" runat="server" Text="Send Data" OnClientClick="return delayer();" OnClick="Button3_Click" /> function delayer(){ showPopUp(); return false; }

Categories : C#

Image at bottom of the page shouldn't be override by the content
You could use z-index? The problem is once you have floated the image it is no longer influencing the layout of your page... text will display on top. Perhaps you could try to display: block; and place it in a div under your text, then have it float right?

Categories : Javascript

Javascript named function definition executed when it shouldn't
Remember, everything in JavaScript is function-scoped; there is no block scope. To that effect, you have two function declarations defined in the same scope (whatever the scope that if-else sits in), with the same name, in different blocks. This produces inconsistent results between browsers. You need to either give those functions different names, or use function expressions, with something like this: var f; if(true) { console.log('In first function definition'); f = function(){ console.log('Hello world'); }; } else { console.log('In the second function definition'); f = function(){ console.log('Goodbye world'); }; } f(); To your excellent question of But how is the function defined, if we don't enter that branch of the code? If that block is not ex

Categories : Javascript

go to another page html with javascript
Since your button is a submit button, I think it is submitting the form after the JS is done and this could be the reason why you don't get redirected to Test.html (as form action attribute doesn't have any value.) Try the below code for the HTML form and check if this solves the issue. <form method="post" action="" name="form1" onsubmit="verif(document.form1.code);return false;">entre the pasword: <input type="password" name="code" placeholder="code" maxlength="6"> <p class="submit"> <input type="submit" name="commit" value="send"> </p> </form> The return false; in the onsubmit attribute prevents the form's default submit action. The verif(document.form1.code) will be executed whenever the form is submitted (that is the submit but

Categories : Javascript

Download a div in a HTML page as pdf using javascript
There is no such a mechanism in jQuery, but you can use plugins like http://www.webresourcesdepot.com/create-pdf-files-with-javascript-jspdf/ Also check this post Is it possible to generate PDF using jQuery?

Categories : Javascript

Localize HTML-Page with JavaScript
Define the variables before trying to store data: label = {}; label["login"] = {}; label["login"]["fr"]="Connection"; label["login"]["en"]="Login"; Or label = { login : { fr : "Connection", en : "Login" } };

Categories : Javascript

How do I load an HTML page in a
You can use the jQuery load function: <div id="topBar"> <a href ="#" id="load_home"> HOME </a> </div> <div id ="content"> </div> <script> $(document).ready( function() { $("#load_home").on("click", function() { $("#content").load("content.html"); }); }); </script> Sorry. Edited for the on click instead of on load.

Categories : Javascript

HTML scrolls simultaneously in page and Flash object
may be this could work for you: $("element").hover(function(){ var scrollT = $(document).scrollTop(); $(document).on("scroll", function(e){ $(document).scrollTop(scrollT); }); }, function(){ $(document).off("scroll"); }); http://jsfiddle.net/ZFsDY/3/

Categories : Javascript

Html Page Search Intercept (JavaScript)
Hmm, this is cool. I'd never thought about doing that. Sadly you can't though. You might be able to capture the search string with a plugin, but seeing as this is for analytics it wont get you the result you want. I tested this in Chrome, and when you press ctrl+f you will see the ctrl press, but not f. So you can't even detect when someone searches. You can detect ctrl+f. Use keydown instead of keypress. I found it here: Stop browser from auto scrolling when searching document (ctrl + f) window.addEventListener("keydown",function (e) { if (e.keyCode === 114 /* F3 */ || (e.ctrlKey && e.keyCode === 70) /* ctrl+f*/ ) { e.preventDefault(); } });

Categories : Javascript

How can I change the content of the "h1" tag of an html page using javascript?
If you're sure you only have one h1 tag you could simply do window.onload = function () { document.getElementsByTagName("h1")[0].innerHTML = "header 1"; } if multiple h1 tags are present you could do window.onload = function () { var h1Elems = document.getElementsByTagName("h1"); var pos; for (pos in h1Elems) { h1Elems[pos].innerHTML = "header 1"; } }

Categories : Javascript

passing data from an html page to another in javascript
If you need to send the data to a new window that you are going to open in that moment, use GET instead and pass the parameters on the url. But, you could create an empty window first, then do your ajax and use the return content to fill your new window. Here is an example fiddle opening the window and filling it with the result of a POST call: http://jsfiddle.net/bxhgr/ var mywindow = window.open(); testArray = [1, 2, 3]; var myUrl = "/echo/json/"; $.ajax({ type: "POST", url: myUrl, dataType: "json", data: { json: JSON.stringify({ images: testArray }) }, success: function (data) { console.log('success'); //alert(data); mywindow.document.body.innerHTML = '<pre>' + data.images + '</pre>'; } });

Categories : Javascript

Getting HTML source of a page by JavaScript and overwriting it
Try something like this to get the page source: document.documentElement.innerHTML And this to change it: document.documentElement.innerHTML = '<body>I like pie</body>' document.documentElement is the <html> ... </html> element on the page, and innerHTML will give is the HTML of it.

Categories : Javascript

How would I change the HTML structure of a page using javascript?
The way jquery works is that you set up a listener to a certain event with custom code to run whenever that happens. Here's an example for the link: <a id="mylink" href="home.html">Go Home</a> The javascript(put this in between your and tags): <script type="text/javascript"> $(document).ready(function() { //This code gets run when the page is finished loading $('a#mylink').click(function() { //Handle the event here }); }); </script> You also asked how you can change HTML dynamically at run time. jQuery has a great function for this .html() Say you have some html: <div id="changeme">Hello</div> The following jQuery: $('#changeme').html("Goodbye"); Changes the page's html to the followi

Categories : Javascript

Get HTML content from page rendered by javascript
something like this? console.log(document.getElementsByTagName('html')[0].innerHTML); or document.documentElement.outerHTML per dan

Categories : C#

javascript showing up as text on my HTML page
<img src="images/100_0350a.jpg" name="slide" width="400" height="400> You should properly close this. <img src="images/100_0350a.jpg" name="slide" width="400" height="400" />

Categories : Javascript

Inserting HTML comments onto page using Javascript
If you use the old-fashioned view source tool, you will probably see the original source. You can verify the changes in FF by using the Inspect Element array of tools. They show the current DOM, after updates.

Categories : Javascript

disabling javascript on HTML print page
after edit you can use window.onbeforeprint = function() { } and window.onafterprint = function() { } ook on webkit this should works var mediaQuery = window.matchMedia('print'); mediaQuery.addListener(function(mql) { if(mql.matches) { console.log('before print'); } else { console.log('after print'); } });

Categories : Javascript

How do I load a nested web page in a
AJAX is what your assignment is looking for. Simple Example HTML: <button id="nav">load</button> <div id="page"></div> JS: document.getElementById('nav').onclick = function(){ var xhr = new XMLHttpRequest(); xhr.onreadystatechange=function() { if (xhr.readyState==4) { document.getElementById("page").innerHTML = xhr.response; } } xhr.open("GET", "http://www.codecademy.com/", false); xhr.send(); } fiddle: http://jsfiddle.net/DZmBG/3/

Categories : Javascript

Cant pass date from Javascript into HTML page
var timecreation=document.createTextNode("p"); should be var timecreation=document.createElement("p"); You cannot append to a text node. JSFiddle Demo

Categories : Javascript

How to update HTML div from second/another page using javascript/Jquery?
the behaviour sounds like a chat behaviour. If all our clients/customers are running with modern browser you can do this with websockets. There is a .Net implementation for websockets available here (http://superwebsocket.codeplex.com/). The advantage of websockets are that they are realtime. So you simply press a button on your ActionPage.aspx and send a message to your server and on your Displaypage.aspx got updated instantly. You can take a look at this Stackoverflow question (server implementation): How to create a WebSocket server using SuperWebSocket And for the client you can use this tutorial: http://www.tutorialspoint.com/html5/html5_websocket.htm

Categories : Javascript

Need to tally certain items on HTML page with JavaScript
have a look here, using jquery: http://jsbin.com/opesok/1/edit code var ignored = [40]; //var ignored = [40, 20]; //another example var redFlagTotal = 0; $(".flag-red").each(function(){ var re = /((.*?))/; var text = re.exec($(this).siblings(".col-question").text())[1]; if(ignored.indexOf(parseInt(text)) < 0) redFlagTotal++; }); alert("Tot: "+redFlagTotal)

Categories : Javascript

Tell screen reader that page has changed in Backbone/Angular single-page app
Overall, you should not need to trigger a 're-read', and depending on your UI that might not be a good thing anyway. My experience has been with angular.js (as an accessibility person rather than the developer), and our overall approach was to manage the focus rather than trigger a re-read. (We do extensive accessibility testing.) The key thing from a UI point of view (primarily for screen reader users) is that selecting a link (e.g. about.html) should take you somewhere. In this case the appropriate place to put the focus would be the top of the content area of the about 'page', hopefully an <h1>. In order for that to work the target element should be focusable via a script, so probably needs tabindex unless it is a link or form control: <h1 id="test" tabindex="-1"> The

Categories : Javascript

Create HTML tag from Javascript object
Why not: $('<img/>', obj).get(0).outerHTML; Fiddle You do not need to wrap it in a div using multiple functions and get the html, just use get(0) to get the DOM element and outerHTML to get the element's html representation. Unless you are using browsers really old you can rely on outerHTML Here is a JSPerf to compare the performance diff between the approaches.

Categories : Javascript

Passing a JSON object from visualwebgui to a htmlbox html page?
Sure this is possible using Visual WebGUi gateway to feed the HtmlBox. Say you have a Form with an HtmlBox, you can do the following: using System; using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Web; using Gizmox.WebGUI.Common; using Gizmox.WebGUI.Common.Gateways; using Gizmox.WebGUI.Forms; namespace VisualWebGuiApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { NameValueCollection NVC = new NameValueCollection(); NVC.Add("JsonParm1", "value1"); NVC.Add("JsonParm2", "value

Categories : Json

Use Adobe TypeKit fonts in an SVG object embedded in an HTML page
SVG is stylable with CSS stylesheets, so you should be able to apply it that way. And as long as the font is registered on the page, you can use textElToApplyFontTo.attr({ "font-family": "myFont" }); Note that IE<9 will likely have problems, I don't know much about VML font support. IE9+ has SVG support, so it should work with that, and all other modern [desktop] browsers. One important thing to consider is that Typekit and other JS-based loading mechanisms work asynchronously, so fonts will only be available once they're loaded. Some modern browsers won't load the font unless a DOM element is using it, so that may also be causing problems (you can try to load the font by using it on a DOM element, preferably above the SVG file. A dirty trick but it works...).

Categories : Javascript

Showing html page inside a php page by echo the html page contents
hmm, a simple html page: <html> <head> <title>Page title</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link type="text/css" rel="stylesheet" href="your-style-file.css" media="all" /> <script type="text/javascript" src="your-javascript-file.js"></script> </head> <body> <div id="div-tag">A div tag</div> <script type="text/javascript" src="another-javascript-file.js"></script> </body> </html> You can load external html file via javascript (or jquery load()). like this: $('#div-tag').load('external-file.html'); Or via php, like this: $external-html = file_get_contents('external-file.html'); print $external-html; Check your javascript, mayb

Categories : PHP

parse javascript get html results for page title
Wrap the returned data in a div first then make your selection. $.get(target, function(data){ var $wrap = $("<div></div>").append(data); var title = $wrap.find("title"); });

Categories : Javascript



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