I have my images at a different site, and wanted the game to access those images. I've changed the links in the other parts of the code, but still get a undefined error, and thought that the below code has the image links wrong, because I didn't add a URL to the code. I'm not sure how to add the URL. Thanks
Here's the specific src codes: -
<img src="'+cardbg.src+'" width=120 height=140 alt="" name="k'+i+'" border=0>
-
-
<img src="'+ima_a[i].src+'" width=120 height=140 alt="" name="s'+i+'" border=0>
-
-
<img src="'+ima_a[i].src+'" width=120 height=140 alt="" name="s'+(i+4)+'" border=0>
Here is the code in its context: - <img src="'+cardbg.src+'" width=120 height=140 alt="" name="k'+i+'" border=0></a></div>';
-
}
-
document.writeln(temp);
-
}
-
-
function block2()
-
{ var temp='';
-
for (var i=0; i<4; i++)
-
{ temp=temp+'<div id="s_'+i+'" style="position:absolute; top:'+(yoff+i*dy)+'px; left:'+xoff_s+'px; width:'+dx+'px; height:'+dy+'px; zIndex:0">';
-
temp=temp+'<a href="javascript:ablage('+i+')"><img src="'+ima_a[i].src+'" width=120 height=140 alt="" name="s'+i+'" border=0></a></div>';
-
temp=temp+'<div id="s_'+(i+4)+'" style="position:absolute; top:'+(yoff+i*dy)+'px; left:'+(xoff_s+dx)+'px; width:'+dx+'px; height:'+dy+'px; zIndex:0">';
-
temp=temp+'<a href="javascript:ablage('+(i+4)+')"><img src="'+ima_a[i].src+'" width=120 height=140 alt="" name="s'+(i+4)+'" border=0></a></div>';
And here is the beginning part of the code, where the URL has been defined: - var leer=new Image; leer.src='leer.gif';
-
var cardbg=new Image; cardbg.src='cardbg.gif';
-
var ima_c =new Array();
-
var ima_ca=new Array();
-
var ima_a =new Array();
-
for (i=0; i<52; i++)
-
{ ima_c[i] =new Image(); ima_c[i].src='c'+i+'.gif';
-
ima_ca[i]=new Image(); ima_ca[i].src='c'+i+'a'+'.gif';
-
}
-
for (i=0; i<4; i++) { ima_a[i]=new Image(); ima_a[i].src='a'+i+'.gif'; }
Its a 9 Patience type game. Thanks!
5 1714
Wrong Beginning Code!
Here is the CORRECT code with the URL's defined: - <!-- Code copyrighted by Ujas at Gamecraft.de -->
-
-
<script language="Javascript" src="http://www.tpgames.net/gaming/2/cards/js/b.js"></script>
-
<script language="javascript">
-
-
zmax=104,rmax=9,kmax=4,smax=8,dx=120,dy=140,dy2=12,xoff=12,yoff=64,xoff_s=xoff+rmax*dx+8, xoff_t=xoff_s+2*dx+8;
-
var count,index,i,gewaehlt,x_alt;
-
var karte=new Array(zmax);
-
var stack=new Array(8);
-
var karten_pro_spalte=new Array(rmax);
-
var f=new Array(rmax*zmax);
-
var liste=new Array(zmax);
-
var xyz=new Array(3);
-
-
// ----- Bilder vorladen: --------------------------------------------------------------
-
-
var leer=new Image; leer.src='http://i107.photobucket.com/albums/m287/tpkyteroo/zgames/cards/tos1/null.jpg';
-
var cardbg=new Image; cardbg.src='http://i107.photobucket.com/albums/m287/tpkyteroo/zgames/cards/tos1/cardbg.jpg';
-
var ima_c =new Array();
-
var ima_ca=new Array();
-
var ima_a =new Array();
-
for (i=0; i<52; i++)
-
{ ima_c[i] =new Image(); ima_c[i].src='http://i107.photobucket.com/albums/m287/tpkyteroo/zgames/cards/tos1/c'+i+'.jpg';
-
ima_ca[i]=new Image(); ima_ca[i].src='http://i107.photobucket.com/albums/m287/tpkyteroo/zgames/cards/tos1/c'+i+'a'+'.jpg';
-
}
-
for (i=0; i<4; i++) { ima_a[i]=new Image(); ima_a[i].src='http://i107.photobucket.com/albums/m287/tpkyteroo/zgames/cards/tos1/a'+i+'.jpg'; }
-
acoder 16,027
Recognized Expert Moderator MVP
Which line do you get an error on?
According to the JavaScript console, there is no error.
I just get a card undefined when I push 'deal to rows' button or 'new draw'.
The only thing I thought I was doing differently from the original script was having the images hosted at a different site, rather than have them in the same folder as the file. I wasn't aware that I had inadvertently changed anything else in the code.
Here's the link to the game: 9 solitaire
I'm going to upload the images to the same folder and upload the original script and see what gives. I'll post a result in a few. Thanks!
Okay, I didn't realize that my javascript console was changed to not auto give errors. After I clicked on show errors, I receive this from my version of the game:
too much recursion line 146 of b.js
my_obj has no properties line 134 of b.js
I also realized, that I had moved the html links to a different location. The only other change I had made was making the cards larger.
However, the cards never deal, New Game doesn't show me cards dealt on my version of game. And, I'm wondering when JS will start making sense to me. LOL
Here is the link to the Original script: Original Script
Original b.js b.js
I am now more confused then before. What I thought was wrong, I'm not seeing as not wrong. Thanks!
I figured out that when I don't have 2 div tags in, the game doesn't work.
So, I've solved the issue. Thanks!
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: j erickson |
last post by:
with the following xsl and xml file, the display of the gif file with
the <image/url> tag works. However, the gif file in the <description>
tag using the name attribute "src" won't make the correct link to the
gif file. why?
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"...
|
by: John Doe |
last post by:
I have a PHP page that generates a list box with several options in it.
I would like to have a "view" link next to the list box. When the user
changes the contents of the list box, I would like the view link to
update to point to the image representing that selection. So for
example, if the list box held names of images I would want the...
|
by: Frances Del Rio |
last post by:
I have a bunch of Photoshop images on my server, I want when user clicks
on a link to a Photoshop img for it to start downloading (like when you
click on a Word file..) how can I do that? thank you.. Frances
|
by: Steve McLellan |
last post by:
Hi,
Sorry to repost, but this is becoming aggravating, and causing me a lot of
wasted time. I've got a reasonably large mixed C++ project, and after a
number of builds (but not a constant number) linking (and sometimes
compiling) becomes immensely slow, and task manager shows that link.exe (or
cl.exe) is barely using any processor time, but...
|
by: kjmatthews |
last post by:
I am designing a site but only have access to a Mac, equipped with
Virtual PC. On IE6 is appears that, on some pages of this site, the
navigation does not appear. I have put up a test case:
http://digitalovertone.com/examples/iedisappear.html. I have stripped
most of the irrelevant CSS from this page.
Please observe: on loading the page,...
| |
by: SR |
last post by:
I have started a web site using ASP.NET 2.0. I would like to centralize all
of my classes in a StyleSheet but I cannot figure out how to link the
StyleSheet to a Content Page since there is no header. I tried to put the
link tag in the Master page, but the classes are not recognized in the
Content Page.
How do I use a StyleSheet with the...
|
by: wavedancer |
last post by:
I am confused about the syntax used in the style sheet that accompanies the website I've inherited and have been asked to tidy up. XHTML is new to me, and I've only used CSS for font and link styles in the past.
The style sheet includes such things as div#header. Is this correct? I thought it should be either div header or #header. I can't...
|
by: liketofindoutwhy |
last post by:
There is a link that encloses a span (or a div), but the link won't
work in IE 7 (clicking on video image works, but not on the play
button), while it works well in Firefox 2 and 3, and Safari 3. The
intention is to make the link clickable on both the play button and
the video image.
the page is http://www.0011.com/test/test_link.html
...
|
by: Bob Bedford |
last post by:
I've to build a website where the customer can buy an image. I'm thinking in
the 2 ways to let people get those images: receive them by Email or send
them an image link wich validity is limited in time.
The second may help me to know if an image has been downloaded and how many
times.
How to build such download link ?
The informations...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |