Disable Images In Javascript
Jun 14, 2006Is there anyway of disabling images in javascript, so that the alternative
text appears instead of the images? I'm trying to do a text-only version of my site.
Is there anyway of disabling images in javascript, so that the alternative
text appears instead of the images? I'm trying to do a text-only version of my site.
i build a website with draging of window like divs, but when somebody drags a div it sometimes selects some images. so im looking for a way to disable selecting images all over the website, i know its posible but i dont know how.
View 3 Replies View RelatedHey, I am able to disable the right mouse button on images for netscape
and IE but it won't work for Opera.
Here is the code:
I have a thumbnail gallery on my website. The thumbnails can be opened in a new window using:
<a href="/images/flowers22.jpg" target="_blank"><img src="images/flowers.jpg" alt="flowers" onClick="MM_openBrWindow('/images/flowers22.jpg','','status=yes,width=630,height=379');return false" /></a>
I have inserted javascript code into my .js stylesheet to disable the right clicking of images on the page where the thumbnails are:
[Code]....
However, when the images open in a new window, the 'no right click' function does not apply. Does anyone know how to disable the right click for the newly opened images?
I want to test/proof some <NOSCRIPT></NOSCRIPT> stuff in my page via PHP but can not figure how to disable JavaScript on my browser.
View 2 Replies View RelatedI have a form, with two drop down boxes. I want to be able to disable
the second drop down box when a specific value is chosen on the first.
I can't seem to figure out how to do this.
Go easy on me, I'm a newbie for the most part, but here is my code...
Does anyone know how to disable javascript in the new Netscape 8 -- for
off line testing (like can be done readily with the current MSIE,
Firefox or Opera browsers) ?
When I try tools -> options -> site controls -> web features and check
or uncheck the 'enable javascript' box, nothing changes -- it stays
enabled.
I've searched FAQs, archives and google about the issue, with no luck.
The odd thing is I swear last summer I managed past the problem
intermittently by clearing the cache, restarting the program, rebooting
the system, or something like that . . . but then got busy with other
things and now I don't recall what I did -- or if I was dreaming.
If no-one else can disable javascript on NN8, then why worry? I don't
know -- to be thorough, I guess. Would a third party security program
'disable javascript' feature be a way to test NN8 under these
circumstances? Or maybe it's the case that the 'disable javascript'
controls in NN8 work only for online content (the reverse of the MSIE
controls). I'll check it out and report back.
I want to know, is there any other methods other than history.forward(), to disable back operation in HTML using javascript.
View 1 Replies View RelatedIf the browser disable the javascript, what happen to Ajax? can i slove
the problem by using server side script? any suggestion for this?
i currently do some dirty projects with perl/cgi, and I would like to
add more client side features which relate to ajax, and do some
validation on the client side with javascript. but it is possible that
the javascript may be disable with some browsers. what can i do if the
client's broweer disable the javascript.
I want to disable a table with javascript. In this table i have 'n' record and each record has 3 buttons. If you click a button does an action. I want to disable the all table.
Is there any way to disable all this table without have to disable each
button of each record?
Does anyone know how to disable selecting when drawing VML objects? I
have a sketchpad program, where I draw polylines when you do a mouse
drag. The problem is that when i drag the mouse, it is drawing the line
but also selecting the previous VML stuff, which is sort of annoying.
Is there a way to disable this in javascript?
I'm working on a little frames based web market research tool (not for public consumption) which allows us select various supplier websites via a link in a header frame, to be loaded in a main frame, from which we may drag data to be dropped into a form in a third form_frame which then submits to our database. All in all, this works nicely until we come to one of the supplier sites which has implemented a frame-killer script.
Now, I know it would be bad form (probably illiegal even) to force a site into the frames of another site for public consumption but I don't think that is an issue here so I ask you all ... Is it possible to disable JavaScript (on the fly) for a given frame only?
I have a form in which I disable the backspace key from going back a page if typed.
It works in IE I can disable the backspace key from going back but not in mozilla. Does anyone know why this does not work in mozilla?
<body onkeydown="if (event.keyCode==8) {event.keyCode=0; return event.keyCode }">
I have a requirement like this
1) I have some code in JavaScript
2) When ever it runs automatically Yellow colored Pop-Up Information Bar ll appears
3) Now i want to completely disable that information bar
4) If i runs that Html file it should be automatically allows ActiveX control pop-up and load all events
a traditional javascript usage such as
<a href="javascript:void(0)"
or
<a href="javascript:doSomething()"
will both show the javascript link on the browser status bar...of
course you can use onmouseover to set the status bar text...but you
need to do on all the link....a little over kill.
Most of the browsers has a feature that prompts the user to save the username or password when filling a form.
I just want to disable this feature. Can i disable this feature using Javascript?
Because there are some users that will not read on the message or information on the pop window that prompts them to save the username and password. I know it can be disabled manually through the browser's preferences.
Is it possible to disable it using javascript?
Should I disable the right click option or not? I have a gallery site, I don't want people to be able to copy the images with the default right click over an image. From a professional looking site point of view I suppose I would be messing with the functionality a bit too much, OR is it OK in this instance to disable the click. I know how to write the code to disable the click, but what I was thinking was maybe it would be better to leave the right click but change the menu options? I'm not sure how to change the menu options ere is a link to the site. [URL]
View 12 Replies View RelatedWANT: Client to save an image to disk pressing a "download" button.
The image name is dynamic, from JS code on another part of the
page
DID: Read somewhere I can use document.execCommand("SaveAs") to do it
This solves it for MSIE, at least. My code is below
PROBLEM: What actually happens with MSIE is:
1) A window pops up promting me to save as.
2) The filename is correct, but the saveas type shown in the box is limited to "html" and "txt"
3) The "image" that is saved is not an image, but an HTML file containing the link to the image!! This is NOT what I want!
PLEASE help. How do I get MSIE to save the actual image instead?
PS With netscape, instead of the saveas dialogue, a window opens with
the image displayed. By clicking <CTRL-S> I can save the actual image.
CODE ----
I have some image data in a Javascript variable, and I want to display
it. I have a technique which works in Firefox but not in Internet
Explorer :
<script>
var testImage = <image data as a string>
</script>
<img src="javascript:testImage"></img>
I understand that this should work in Javascript 1.2 and above, which
supports null characters in strings. Does anyone know why this doesn't
work in Internet Explorer?
Let's say I have a Javascript function that loops over and over. In
that function i have it alternating images on a button this way:
if(var==0){
var myHTML = "<input type='button' style='background-image:
url(grnbutt.jpg);etc. etc.'>";
var outq = document.getElementById("qbutt");
outq.innerHTML = myHTML;
}
else{
var myHTML = "<input type='button' style='background-image:
url(grnbuttdark.jpg);etc. etc.'>";
var outq = document.getElementById("qbutt");
outq.innerHTML = myHTML;
}
This works great using Firefox, and works with Internet Explorer also
EXCEPT if its set to "Check for newer versions of stored pages: Every
visit to the page". With that setting, IE will download those 2 images
from the server every single time through the loop. So then I tried
putting both images on the same jpg and then moving the image:
if(var==0){
var elem = document.getElementById("grn");
elem.style.backgroundPosition = "-100px 0";
}
else{
var elem = document.getElementById("grn");
elem.style.backgroundPosition = "center";
}
This also works, but also, constantly downloads new images when using
IE with the above setting. Microsoft calls this a "feature". They then
offer a fix for this "feature" that... doesn't work. Preloading
doesn't work. Loading the 2 images in a <divset to invisible doesn't
work. I've tried suggestions of creating php files that tell the
browser that the images don't expire for years. That didn't work for
me. Many people have also suggested that there is no way around it...
it can't be fixed until Microsoft fixes it.
So, is there any javascript way to loop 2 images on a button, without
Internet Explorer constantly downloading those 2 images over and over,
when its set to "Check for newer versions of stored pages: Every visit
to the page"?
I have a site that I have a bunch of rollovers for..
I have a preload image script as follows:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
image1 = new Image();
image1.src = "/images/image1-over.jpg";
image2 = new Image();
image2.src = "/images/image2-over.jpg";
// End -->
</script>
This works just fine for NETSCAPE... it preloads it, so you can cruise over the rollovers perfectly without wait the first time you load.
However, with IE, it doesn't work the way it should, and it still takes time to load each rollover when you hover the first time. And they don't seem to cache properly and you're constantly reloading them.
For years I used a javascript code to generate random banners/images in my site. Everithing worked fine.
But recently I moved to another host and the code dosnt work properly, i.e., if you open the browser and go to www.megafarol.pt the imagens dont show up. You need to hit Refresh to work properly. Also, if you return to that page, then everithing works fine.
I have seen lots of PHP scripts and javascripts for what I need, but none that seem to fit exactly.
I'd like a simple page with two image windows, the same size, one on the upper left and one on the upper right. The images are about 250 x 200. I'd like the pictures in these panes to change randomly. It's sort of a slideshow, except that I'd like the images to change from a random pool of images and it will be automatic; there will be no previous/next buttons or links.
I've seen a PHP slideshow that did this, but only when the page was refreshed. I've seen javascript slideshows, as well. I've used a Dreamweaver extension called flevOOware in the past.
Can anyone recommend some javascript that would work for this? Ideally it could work for multiple images on a page.
I had opportunity to meet with Creole a few days ago and we were discussing some options to pursue in the Build forum. I thought I'd start here in javascript and find out methods users use to preload images. I realize that this information can likely be found in a google search, but if we can get some good insight, maybe start putting an FAQ of javascript issues for Sitepoint Forums together. What do you think?
View 1 Replies View RelatedI have created a Javascript menu for my site which uses frames. The first
stage loads fine but I want two drill down menus ("About Me Menu" and
"Projects Menu"). The pages load fine, but the images aren't displayed,
instead the alt text is shown. The images come up after you "Mouse Over"
them but not before......can anybody spot any errors in my code which could
be doing this please. For info, I have 4 images for each button, to take
into acount whether the button had been used and to give a mouse-over image
for each state. I have also deleted the code for items 3-5 as they are
commercially sensitive. Code:
This javascript is meant for learning language vocabulary, specifically
colours on this example. However, when I use images in the mtWord array,
it breaks when checking for correct answers. It works fine with text in
those spaces. Code: