Link to home
Start Free TrialLog in
Avatar of Sirocco
Sirocco

asked on

How to prevent displaying a url of the image in browser status bar?

How to prevent displaying a url of the image in browser status bar at the bottom when page loads? ('Downloading picture: http://.. )
Aftern page has loaded, there are no problems. Only when page loads.
Is there a way to solve this ?
Avatar of davidlars99
davidlars99
Flag of United States of America image

Sirocco, don't get me wrong but I think it would be illegal for anybody to answer that kind of question here, I only can say that such things are not possible with 99% of modern browser and and that 1% would be IE, please read this article

http://bmonday.com/articles/496.aspx
Try putting this as the line below the <body> tag:

<script language="javascript" type="text/javascript">window.status = 'Loading page...'</script>

Two caveats. One, this one stop people with Firefox from preventing you from doing this, and second, I'm not sure if it works (I'm in no position to test because I have a highspeed connection and images are loading too fast to see the statusbar text. :) )

You might also want to considered why it matters whether a user knows where the image comes from.

Are you hotlinking them from a different site? :( If so, beware of hotlink pranksters who can serve up a different image specifically to your site and make you look bad. Or they could just disallow you from using the image. Just save the image to your own site and use that one.
"One, this one stop people with Firefox from preventing you from doing this"

Supposed to be:
"One, some people with Firefox can block you from modifying the window status."
Don't know where I got the first one.

Cd&, in my opinion this question can proceed within MA guidelines, but it depends on what direction he wants to go with this.
anything that you can come up using  -->  window.status  <-- would be OK I guess, but I was thinking about how one can hijeck  IE and manipulate its whole status bar...  :)
or you can I also do it this way, but why...?

document.onmousemove=Ms_move;
document.onmouseover=Ms_move;
document.onmouseout=Ms_move;
document.onload=Ms_move;

function Ms_move(evnt){
     window.status=" ";
}
I personally have very little use for sites that try to mess with the chrome. That I way I use Firfox and block such feeble attempts to deceive me.  If you are trying to somhow hide the location of the image it is not going to do you much good right click will give me the properties ncluding the url, and it is in the source code.

The only time I have seen sites trying to do this is when the are up to no good, so it would automatically put me on alert if I went to the site.

What I would really be interested in hearingis exactly what you think you are going to accomplish; and what makes you think you have the right to manipulate MY browser.

Cd&
Avatar of Sirocco
Sirocco

ASKER

The reason to prevent url from displaying when page is loaded is simple(and legitimate, i think!): I just use statistic cgi script to track visitors, its called from image tags. That's all.. Dont see there any violation. I just dont want that this will too 'notified'...
So, I want something that works in 99.99%, and works good.

Any good ideas?
Avatar of Sirocco

ASKER

P.s. I need that it works good on fast broadbad connections, not only on archaic modems..
From other hand, may be some trich with url can be helpful??  Dont' know..
>>> I want something that works in 99.99%,

Not going to happen.  you will not even get close to 90%  

Based on stats FF/Moz have somewher between a 15% and 30% market share.  You cannot modifiy the status on those computers unles the users permit it.  With FF/Moz, control of the browser is in the hands of th euser where it belongs.

Cd&
if you use a .hta file There is no status bar.
so no one is seeing what should normaly be in the status bar. cauze the is not one. windows.status does nothing in an hta , becauze the status bar , is not present.

Pros: hta file are runned as a program so some security feature are removed eg: u can write a file on the harddrive or load an activex Without the security warning

Cons: hta file need to be runned from the client machine , by double clicking on it , not available from a webserver , if you try , users will be asked to save as the .hta file
you forgot one con; a big one.  IE only so if 65% of users is enough great...oh wait did I say 65% No, we have to subtract all the one who won't be able to download because it will be blocked.

Hmmm.... screendoor on a submarine?   Must be the Canadian Navy ;^)  <no email please, I'm Canadian so I can say that>

Cd&
Avatar of Sirocco

ASKER

Well, it will enough for me if this work on MSIE and Netscape browsers. Its will good for me.

Now, have the skilled experts some good code snippet sample?
for IE:
 basically the trick is to have your page loaded before your browser starts loading images, then after when the page is loaded, dynamicaly insert your images [in a Div or any other element of your choices]
as showed in this exemple , so the pictures will show up , without having the   ('Downloading picture: http://.. ) in your status bar ,

-becauze the ('Downloading picture: http://.. ) only show when the page is not beeing completely loaded, becauze images within the <body> are not done beeing downloaded

-When ('Downloading picture: http://.. ) shows,  onload event as not been launched yet , becauze content of the original page are not yet downloaded from the webserver, having the browser explaining to the user why is the page not allready loaded]
code exemple
====
<html>
<head>
   <title>image to div post load</title>
</head>
<script language="javascript">

        //function who will be launched when the page as been loaded to show the img[s]

function createimg(){

    // bob is the Id of the div were the img will be shown,
    // innerHTML means add this HTML code between <div id=bob><--HERE--></div>
       bob.innerHTML = "<img src='http://www.google.ca/images/logo_sm.gif'></img>";

}
</script>
<body onload="createimg();">
<div id=bob>image will go here</div>
</html>
========
let me no if it is working for you
you might get an activex popup .. ..
Avatar of Sirocco

ASKER

There are <body> tags missed it seems, it should go probably right after </head>?
And rest images, that not required to be suppressed,- goes as usually?

However, I found the solution that works well: I just use status bar scroller script('typewriter'), its add nice message.
 
http://javascriptkit.com/script/cut74.shtml

The status bar now show just "page opening.." and right after that show scrolling text. Loading of images is not visible anymore.


the <body> is right after the </script> , so the functions are ready to be fired even before html start beeing displayed , then when loading beeing done, it will fire the function createimg() . having no images charged during load, ('Downloading picture: http://.. ) wont show up.
Avatar of Sirocco

ASKER

This not work for me. However, probably i not fully unerstand how this code must be inserted. Since Javascript code must be inserted one of two ways only: between <head> </head> tags, or between <body> </body>  tags.  There are no other ways.
Sirocco, it's not gonna work the way you want it to work! browser's default behavior cannot be overriden no matter what and how you do it unless breaking some rules!!!
Avatar of Sirocco

ASKER

I find solution already (please see my comment). I just wanted specify, that code provided by gurujr is not work.There is errors.
Avatar of Sirocco

ASKER

Please refund my points, since nobody offer the solution. I have the solution myself.
Thank you.
Sirocco, with all my respect to you, I think that in order to ask for a refund after so many good inputs, you have to at least prove that you have the better solution. besides that, personaly I'd love to see it

Avatar of Sirocco

ASKER

HERE IS SOLUTION THAT WORK FOR ME (I FIND IT MYSELF)--VERY NICE SCROLLER, AND VERY HANDY. ENJOY!

<!--

   http://www.geocities.com/CollegePark/Quad/3400
   http://javacentral.home.ml.org
   http://www.page4life.nl/javacentral/index.htm

   (c) 1997 Semian Software, Script by: Michiel steendam
   Modify and use anyway you want, just mention this site.
   -->

  <SCRIPT>
  <!-- Hide from old browsers

  // All you have to do is put another text in the variable message.
  // Don't forget to break all lines with a ^
  // When you do not place a ^ at the end of all the message, the
  // message will not repeat

  message     = "This is another example of a simple typewriter example^" +
                "You can enter an unlimited number of lines here^" +
                "Please, take a look at the code for a more detailed description^" +
                "Created by Michiel Steendam^" +
                "This typewriter will repeat now ...^" +
                "^"
  scrollSpeed = 25
  lineDelay   = 1500

  // Do not change the text below //

  txt         = ""

  function scrollText(pos) {
    if (message.charAt(pos) != '^') {
      txt    = txt + message.charAt(pos)
      status = txt
      pauze  = scrollSpeed
    }
    else {
      pauze = lineDelay
      txt   = ""
      if (pos == message.length-1) pos = -1
    }
    pos++
    setTimeout("scrollText('"+pos+"')",pauze)
  }

  // Unhide -->
scrollText(0)
  </SCRIPT>
Siricco, that's not what you wanted! You wanted completely different thing for completely different task. I'll give you something more dinamyc, check it out


<html>
<head>
<script language=Javascript>

var speed = 5
var pause = 1500
var timerID = null
var bannerRunning = false
var ar = []

ar[0] = "This is another example of a simple typewriter example"
ar[1] = "You can enter an unlimited number of lines here"
ar[2] = "Please, take a look at the code for a more detailed description"
ar[3] = "https://www.experts-exchange.com/questions/21408273/How-to-prevent-displaying-a-url-of-the-image-in-browser-status-bar.html"
ar[4] = "Modify and use anyway you want, just mention this site."
ar[5] = "All you have to do is put another text in the variable message"

var message = 0
var state = ""

clearState()
function stopBanner() {
     if (bannerRunning)
          clearTimeout(timerID)
           bannerRunning = false
}
function startBanner() {
     stopBanner()
     showBanner()
}
function clearState() {
     state = ""
for (var i = 0; i < ar[message].length; ++i) {
          state += "0"
     }
}
function showBanner() {
     if (getString()) {
          message++
     if (ar.length <= message)
         message = 0
     clearState()
timerID = setTimeout("showBanner()", pause)
          bannerRunning = true
     } else {
          var str = ""
          for (var j = 0; j < state.length; ++j) {
               str += (state.charAt(j) == "1") ? ar[message].charAt(j) : "     "
          }
          window.status = str
          timerID = setTimeout("showBanner()", speed)
          bannerRunning = true
     }
}
function getString() {
     var full = true
for (var j = 0; j < state.length; ++j) {
          if (state.charAt(j) == 0)
               full = false
}
     if (full)
     return true
     while (1) {
     var num = getRandom(ar[message].length)
          if (state.charAt(num) == "0")
               break
     }
     state = state.substring(0, num) + "1" + state.substring(num + 1, state.length)
     return false
}
function getRandom(max) {
     return Math.round((max - 1) * Math.random())
}

</script>
</head>
<body onload="startBanner()">
</body>
</html>
Avatar of Sirocco

ASKER

Well, it looks not bad, thanks.

But I can confirm, that i also use the script I mentioned, exactly to prevent displaying of image url in status bar when page loads. With this script help I get that the status bar now show just "page opening.." and right after that show scrolling text. Loading of images is *not visible anymore* -- i.e. my task is solved.
I don't see it working the same way as you do!

Avatar of Sirocco

ASKER

Its works for me, MSIE 6.0. Probably scroller script loads first, so its cover image loading status.
I have same browser
Avatar of Sirocco

ASKER

You should not see any image uploaded anymore, since technical solution I use completely block all status bar notification message. No any messages anymore, never, all messages suppressed completely.
the only way that I've found so far is to load images into an Image object and thus ignoring the statusbar

var img=new Image;
img.src="http://www.domain.com/myimage.jpg"
Avatar of Sirocco

ASKER

could you show how this will look in complete html page?
Anyway, I tried the script I mentioned, and it works and do the task as I expected. Plus, it gives me a nice scroller, in additional.
ASKER CERTIFIED SOLUTION
Avatar of davidlars99
davidlars99
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sirocco

ASKER

Not fully clear. Could you show here a some html example to illustrate this with few images?
Avatar of Sirocco

ASKER

Where you take images from? Does you use local path for images?
Avatar of Sirocco

ASKER

Please close my question, I have find the problem solving. Thank you.
Avatar of Sirocco

ASKER

Please close my question, and refund points, I have find the problem solving. Thank you
Avatar of Sirocco

ASKER

Please award me points as most useful solution.
If my recommendation is unacceptable then post in CS and ask fo r a review.

Cd&
Avatar of Sirocco

ASKER

No good, clear, exact and useful answers and ideas has beed offered for my question. I am sorry.
Avatar of Sirocco

ASKER

Oh, what means CS? Its much more better if just provide me with exact url where I schould go. Extremelly inconvenient user interface on EE board. I asked to improvethis few years ago, to make EE human readable,  -no any results.