Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Why my JScript doesn't work anymore?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Solang  
View profile  
 More options Nov 1 2009, 12:00 am
Newsgroups: microsoft.public.scripting.jscript
From: "Solang" <sol...@verizon.net>
Date: Sat, 31 Oct 2009 18:00:51 -0600
Local: Sun, Nov 1 2009 12:00 am
Subject: Why my JScript doesn't work anymore?
  I had my JScript working a few years ago and now it stop working.
If I place these png files under the same directory, it works. But
if I place them in /image/ , it does not display correctly. How do I fix it?

Thanks in advance.

Here is the code :

function init_image()
{
      var url = "/image/";
//      var url = "./";
       pieces[ 0]="SQUARE.png";
       pieces[ 1]="NPAWN.png";
       pieces[ 2]="NFPAWN.png";
       pieces[ 3]="NQUEEN.png";
       pieces[ 4]="NKNIGHT.png";
       pieces[ 5]="NBISHOP.png";
       pieces[ 6]="NROOK.png";
       pieces[ 7]="NKING.png";
       pieces[ 8]="SPAWN.png";
       pieces[ 9]="SFPAWN.png";
       pieces[10]="SQUEEN.png";
       pieces[11]="SKNIGHT.png";
       pieces[12]="SBISHOP.png";
       pieces[13]="SROOK.png";
       pieces[14]="SKING.png";
       pieces[15]="WPAWN.png";
       pieces[16]="WFPAWN.png";
       pieces[17]="WQUEEN.png";
       pieces[18]="WKNIGHT.png";
       pieces[19]="WBISHOP.png";
       pieces[20]="WROOK.png";
       pieces[21]="WKING.png";
       pieces[22]="EPAWN.png";
       pieces[23]="EFPAWN.png";
       pieces[24]="EQUEEN.png";
       pieces[25]="EKNIGHT.png";
       pieces[26]="EBISHOP.png";
       pieces[27]="EROOK.png";
       pieces[28]="EKING.png";
       for (var i=0; i<pieces.length; i++)
       {
           pieces[i] = url + pieces[i];
//      alert(i+' '+ pieces.length+' '+pieces[i]);

       }

}

function display_board()
{
   var i=8;
   var j=0;
   var k=0;
   var v=0;
   var r,x,y;

   for (y=0;y<=YMAX;y++)
   {
      for (x=1;x<=XMAX;x++)
      {
         r=document.getElementById('my_table').rows[y].cells;
            v=my_board[x-1][YMAX-y-1];
            if (v>=0)
            {
               while (r[x].childNodes.length > 0)
                    r[x].removeChild(r[x].childNodes[0]);
              var spanNode = document.createElement('img');
              spanNode.src=pieces[v];
// alert(pieces[v]);
              spanNode.width=wl;
              spanNode.height=wl;
              r[x].appendChild(spanNode);
            }
      }
   }


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Trevor Lawrence  
View profile  
 More options Nov 1 2009, 3:10 am
Newsgroups: microsoft.public.scripting.jscript
From: "Trevor Lawrence" <Trevor L.@Canberra>
Date: Sun, 1 Nov 2009 14:10:04 +1100
Local: Sun, Nov 1 2009 3:10 am
Subject: Re: Why my JScript doesn't work anymore?
I think that the only problem is that the first statement should read

      var url = "image/";

--
Trevor Lawrence
Canberra
Web Site http://trevorl.mvps.org

"Solang" <sol...@verizon.net> wrote in message

news:OE4LmZoWKHA.3696@TK2MSFTNGP02.phx.gbl...


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Solang  
View profile  
 More options Nov 1 2009, 2:25 pm
Newsgroups: microsoft.public.scripting.jscript
From: "Solang" <sol...@verizon.net>
Date: Sun, 1 Nov 2009 07:25:36 -0700
Local: Sun, Nov 1 2009 2:25 pm
Subject: Re: Why my JScript doesn't work anymore?
Hi Trevor,

   The reason I want to put all those png file under /image is to
allow multiple pages to access them such as :
http://mysite.verizon.net/solang
http://mysite.verizon.net/solang/work

So, the /image/ doesn't work like before(many years ago).
I spend a few hours playing with this issue and find a partial solution
by using this :
function init_image()
{
      var url = "http://mysite.verizon.net/solang/image/";
..

}

I have two web site and another one is   http://jinpusa.angelfire.com/

function init_image()
{
    var url = "http://jinpusa.angelfire.com/image/";

}

This angelfire is very stubborn and no matter what I've tried, it just
doesn't work.
Howver, when I ftp the file, it gave me a warning that this html file has
only linefeed
and no carriage return.

I still like to use "/ " as top level directory.

Thanks.

"Trevor Lawrence" <Trevor L.@Canberra> wrote in message
news:u7fxPDqWKHA.3720@TK2MSFTNGP02.phx.gbl...


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Trevor Lawrence  
View profile  
 More options Nov 2 2009, 1:17 am
Newsgroups: microsoft.public.scripting.jscript
From: "Trevor Lawrence" <Trevor L.@Canberra>
Date: Mon, 2 Nov 2009 12:17:24 +1100
Local: Mon, Nov 2 2009 1:17 am
Subject: Re: Why my JScript doesn't work anymore?
I am confused as to where the images are

For both  http://mysite.verizon.net/solang and
http://mysite.verizon.net/solang/work, are they on
http://mysite.verizon.net/image

If so, I assume you have files such as
http://mysite.verizon.net/solang/index.html which want to access images such
as http://mysite.verizon.net/image/image1.png
In ths case the reference would be "../image/image1.png"

"../" moves up one level (to http://mysite.verizon.net/)
"image/" moves to the image directory (i.e.http://mysite.verizon.net/image/)
"image1.png" adds the filename

But if you are in http://mysite.verizon.net/solang/work/index.html and want
to access images such as http://mysite.verizon.net/image/image1.png, you
would have to use
"../../image/image1.png"
That is you need to move up two levels to get to http://mysite.verizon.net/
.  Then you go down the structure to get to "image/image1.png" as before

Reference:
http://www.webdevelopersnotes.com/design/relative_and_absolute_urls.php3

You may find it easier to use absolute urls, as in your example

--
Trevor Lawrence
Canberra
Web Site http://trevorl.mvps.org

"Solang" <sol...@verizon.net> wrote in message

news:%23B5e68vWKHA.3428@TK2MSFTNGP06.phx.gbl...


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Solang  
View profile  
 More options Nov 2 2009, 1:09 pm
Newsgroups: microsoft.public.scripting.jscript
From: "Solang" <sol...@verizon.net>
Date: Mon, 2 Nov 2009 06:09:03 -0700
Local: Mon, Nov 2 2009 1:09 pm
Subject: Re: Why my JScript doesn't work anymore?
 Both  http://mysite.verizon.net/solang and
http://mysite.verizon.net/solang/work,
has board1.html file that is using the image(png) files. And those image
files are in
http://mysite.verizon.net/image.

The reason that I want to use "/image/" is to avoid modifying board1.html.
Using
absolute(var url = "http://mysite.verizon.net/solang/image/")  or
relative(var url="../image/";)
will require changing board1.html. Here is the list of the files that are
required for a given page:
index.html
move.html
music.html
board1.html
IsThere.class
and those image(.png) file and two mp3 files.

Theese files were uploaded to the web by my C++ application using ftp SDK.
The only file that was generated by the C++ is move.html that put PGN file
into listboxes.

If I can not use var url="/image/", then I have to write a small function in
my C++
application to modify the board1.html.

BTW, in the old JScript API, isn't "/" an equivalent to the topmost dir?

"Trevor Lawrence" <Trevor L.@Canberra> wrote in message
news:O7eU8o1WKHA.2388@TK2MSFTNGP02.phx.gbl...


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Trevor Lawrence  
View profile  
 More options Nov 7 2009, 1:45 am
Newsgroups: microsoft.public.scripting.jscript
From: "Trevor Lawrence" <Trevor L.@Canberra>
Date: Sat, 7 Nov 2009 12:45:15 +1100
Local: Sat, Nov 7 2009 1:45 am
Subject: Re: Why my JScript doesn't work anymore?

You are correct - the reference
<a href= "/filename.html"></a>
does locate to "filename.html" on the root.

I have tested this on my website, using IE7.

In the file http://tandcl.homemail.com.au/caroles_stories/abraham_part1.html
,
I added the code
<a href="/siteinfo.html">Test </a>
and clicking on Test opened http://tandcl.homemail.com.au/siteinfo.html

So if "image" is a directory on the root, i.e.
http://mysite.verizon.net/image
and the file to be opened is http://mysite.verizon.net/image/SQUARE.png
this should write code which when clicked will locate to it from anywhere

var url="/image/";
var newurl = url + "SQUARE.png";
document.write("<a href='" + newurl + "'>Click to open me</a>");

--
Trevor Lawrence
Canberra
Web Site http://trevorl.mvps.org

"Solang" <sol...@verizon.net> wrote in message

news:%23ScKra7WKHA.4780@TK2MSFTNGP05.phx.gbl...


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google