I have a menu, on which is a delete link. The URL of the link is quite plain: <a href="http://mysite.com?delete=true&id=123">http://mysite.com?delete=true&id=123</a> (quite obvious I think that the request is to delete the id=123) I wish to hide the destination URL in the browser from the user - so that it shows a harmless url like: <a href="http://mysite.com?#">http://mysite.com?#</a> or similar. The reasons are more aesthetic than anything else. Also the other advantage is once the user clicks on the link, and then hits on refresh, the request gets posted again and because the id=123 has already been deleted, it will just generate an error. I dont mind using ajax for this - ajax and non-ajax.<br clear="all">
Inside of an img tag I have an onclick that fires a function. The function is supposed to change the src of a larger image elsewhere on the page. Think: click the thumbnail to see it at the enlarged_image that is on the page.
I tried this function but it doesnt work =/
function doit(){ var node = this; var nodesrc = node.getAttribute("src"); dest_img.setAttribute("src", nodesrc); }
I dont think 'this' is doing what I want it to, plus I get the error that node.getAttribute() is not a function.
I have a print button in PHP page which using javascript window.print() to print web page.
However , when user click "print" , the print preview display that the page cut-off and alignment is out.
Read on regarding the matter , and found that is not the issue of PHP . Some users recommend to me to use CSS and HTML to create printer friendly page. However my page is extension is in php , can i use CSS and HTML to create printer friendly page?
many framed sites have an ancient script in all their pages: if(top==self) top.location=theframeset
Some friendlier ones do this: if(top==self) document.write( '<a href=frameset>This page is ' + 'supposed to be frames</a>.' )
These scripts fail when the page is loaded within somebody's else's frameset.
Then top is not self but not a very cooperative top either. And with ever growing security issues browsers have become quite paranoid. Even testing for top's origin results in an error:
alert(top) // gives me [object] var s='' for (var i in top) s+=i+' '+top[i]+' ' alert(s); var obj; try{ obj=top.location; } catch(e) { obj='' } // give me [access denied] (of course)
I 'd rather drop the frames altogether, but the site has been like this for years and the client insists. There are frames. So how would I detect when it is appropriate to write:
<a href=>View this page in its <b>own</b> frames.</a> ?
Question b: in the frameset, a little script looks into self.location.search for an url with which to fill the main frame. Is there a way to avoid document.write and onload?
When the user clicks on the password form field, the background image is suppossed to be replaced with a white background color. All I get is a javascript error, and I copied straight out of the newsletter.
I have an html based website that needs urls converted from [URL] to [URL] the website has no mysql database. the urls are written through javascript. download from below the js + html files Code: [URL] urls writing rules can be found on common.js and set_form_menu.js.gz files
I am developing a site for a client that requires the printer friendly verison of the site to appear in a separate pop-up window. I am having trouble figuring out the scripting needed to have the current page open in a separate window with a different style sheet applied to it.
Here is my code that works flawlessly in IE but I can't get it to work in firefox. what firefox doesn't like about this code?
<SCRIPT language="JavaScript" type="text/javascript"> //POPULATE COMBO BOX PER RADIO BUTTON CHECKED function UpdateCombo() {
[code]...
Now, I obviously left unrelated code out here; but that code is the basic of what Im working with, but the combo box is just empty in firefox. Works fine in IE; so I'm guessing it doesn't like something with the code:
I've added the most basic implementation of JQuery tabs. It's working fine so long as there's not a url-friendly query string.In other words, if I load index.php, it will work fine. Even index.php/anystring doesn't have any problems. However, if I try to load something such index.php/anystring1/anystring2, none of the CSS styles for the tabs appear to be applied to the tabs list making all the tabs' contents appear on the same page.how I can work around this to ensure I can preserve the current format of query string without breaking the tabs? Using the old fashioned way doesn't appear to result in any problems, but I'm trying to avoid having to revert to that format.
I am new to jquery and i will need a script for 2 jquery Slider, where the Max value of the second slider is the actual of the first slider. If the first slider will be changed the max should be changed too.
someone had been asking about getting images to load in a specific order a while back, and while i was thinking about that, i came up with the following preloader script. the thing that separates this one from most of the other ones you'll find is that it lets you know if any of the images didn't load. if i weren't too lazy (i'm actually posting 'cause i'm hoping someone will do this for me), i'd connect the XmlHTTP request object to the array of failed image urls, and get the actual error headers, too.anyway, here it is. it takes an array of url strings to load, and returns an array of the ones that failed, for whatever reason.
function preLoad(args){ if (document.images){ var img = new Image(); var failed = []; img.onerror = function(){ failed[failed.length] = this.src; if(args.length > 0){ this.src = args.shift(); } } img.onload = function(){ if(args.length > 0){ this.src = args.shift(); } } img.src = args.shift(); } else { var failed = args; } return failed; }
I need to know how to get the actual screen size in points or centimeters, not in pixels. The javascript functions give me the pixels, but I need to know how many points or centimeters that is regardless if it comes from a browser or a device like an ipad or iphone. Does anyone know the code to calculate this?
My question is, can I get the actual size of a div's content when div's width is 'auto' and the content is small enough to fit without resizing. I know there is a way to find the div's actual size after it's loaded - divObj.offsetWidth/Height. The problem is that this only works for content which is bigger than the div.
For example, Code: <div style="width:30px;">A text that will exceed 30px in width</div> In this case, when the content is loaded the div will be resized and get a new offsetWidth/Height. There will be lots of new lines after the resizement which posses another problem.
After loading, the above example will look like this: Code: A text that will exceed 30px in width
Now the example has offsetWidth little more than 30px (~50) and MUCH greater height. This is not the desired effect. I want the width/height of the content when the div is not resized by the content.
I've search all over to find a way to simulate an actual click on an element using javascript or jquery.
For example, suppose there is an element with id="someElement". I've tried
$('#someElement').click(); and $('#someElement').trigger('click');
But this doesn't work. You might think "Why don't you just call the function that is triggered by the click event, or redirect to the url that a click would lead to anyway", but I can't do this.
I have created a grid of images and want them to scale up, similar to google images. I'd like to be able to get at the actual size of an image, rather than the current size. Is there a JQuery function that does this? It seems the width() method only retrieves the current size.
Is it possible to pass a variable into a if statement, What I mean is the function takes in variables i need to take one of those variable and put it in the actual statement.I need the check variable to be put in the if statement but all it does is throw an error because it can't find "check".
I need an image to move from outside the viewed space, from somwhere on the page where users cannot hav acces, let's say from x position of -439px to 0px, so that the image looks like entering the window. And I need to do this after the user clicks a piece of text that is already on the screen. How can I do that ? In what tag should I include the image ? where should I put de event handler/ listener ? I know I need to change the CSS atributes but how. I tried this and it didn't work in Firefox nor in IE. THE HTML FILE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html>