473,761 Members | 9,474 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Change single number in embed attribute every time page visited

27 New Member
Hello,
first to say that I am a total beginner in Javascript but I know some programming (python in particular) and am able to understand methods/parameters and so on.

Here's my problem:
I am trying to set up a page that changes every time it's visited, but without using php(which i don't know either) because it's not active on the server. The thing that should change is a single number in one attribute of an <embed> tag inside an <object>. The attribute itself is a long string of attributes - settings for the flash that runs in this embed-tag. In general I would like to change the number according to a file storing the number of visits and increments it with each new visit. So I need to set the whole attribute (which is a string called 'list' in the code below) from outside - with a javascript.

What I am trying now is simply setting the attribute without any changing/files. It looks like this:

[HTML]<script type="text/javascript">
function lista()
{
var list = "url=search_fil es/foret.swf&amp;f euilles=2&amp;o bjectif=1000000 00&amp;texte=Ke ep the left mouse button pressed &lt;br&gt; and move to look around.&amp;zoo mM=Zoom %2D&amp;zoomP=Z oom %2B";
document.embeds[0].setAttribute(" flashvars", list);
}
</script>[/HTML]

and the whole <object> looks like this:

[HTML]<object id="Flash" codebase="http://download.macrom edia.com/pub/shockwave/cabs/flash/swflash.cab#ver sion=6,0,40,0" classid="clsid: D27CDB6E-AE6D-11cf-96B8-444553540000" height="377" width="481">
<embed src="search_fil es/loader.swf" quality="high" bgcolor="#B3F28 5" name="&lt;NAME& gt;" type="applicati on/x-shockwave-flash" pluginspage="ht tp://www.macromedia. com/go/getflashplayer" height="377" width="481"></object>[/HTML]

I execute the function onload but the flash doesn't seem to get the parameters and stops after it's initial animation contained in the loader.

Where am I making a mistake?
May 16 '08 #1
5 2170
acoder
16,027 Recognized Expert Moderator MVP
To change the number each time without using server-side code, you need to use cookies.

Changed the thread title to better describe the problem.
May 16 '08 #2
elbin
27 New Member
Thank you for changing the title, I'll write more specific next time. Now i understand the cookies, but I still don't know why the code I gave you doesn't work. It doesn't set the embed attribute. I suppose I should put it into the checkCookie function that executes onload, but why doesn't it work?
May 19 '08 #3
acoder
16,027 Recognized Expert Moderator MVP
It probably doesn't work because the string being passed needs to be URL-encoded. Have you got it working with cookies?
May 20 '08 #4
elbin
27 New Member
I tried it but it doesn't work. I put the setattribute statement in the case when the cookie does not exist.

When I said I understood cookies I didn't mean I was able to use them, I just understand what they do generally. What do you mean URL-encoded?
May 20 '08 #5
acoder
16,027 Recognized Expert Moderator MVP
Read this technote by Adobe.
May 20 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

14
3894
by: NotGiven | last post by:
I am guessing I would hold a variable of when it's opened, then in the script that runs when the page is offloaded, I coudl calcualte it. How do you store a time variable? How do you calculate the amount of time (seconds) based on two timestamps? Thanks for your help and/or links to articles on the subject!
3
17092
by: Matt Adams | last post by:
As well known I could specify the text color in the body tag like: <BODY TEXT=WHITE LINK=WHITE VLINK=RED ALINK=WHITE> What I want to achieve now is that always (!) the text of the last visited link and the text of the link under the cursor are red. All other links should be white. The problem with the construction above is that a visited link remains for the rest of the session red regardless wether it was visited 17 clicks back in...
11
4498
by: Anna | last post by:
Hi all. I want to embed the EMBED tag in the object tag. I understood that I need to provide a PARAM tag inside the OBJECT whose value will hold the content of EMBED src attribute, but after that I've got confused. For example, what should be put into classid and codebase attributes of the OBJECT now embedding the EMBED tag?
18
10747
by: Jan Tuxen | last post by:
Jakob Nielsen in his most recent Alertbox (http://www.useit.com/alertbox/20040503.html) tells web authors to change the color of visited links. I agree to his purpose: Help users understand where they have been. I also agree to the background: Too many web authors keep uniform link colors or their pages, thereby confusing the users. What I have a hard time agreeing to is his conclusion that web authors should deliberately change the...
9
5538
by: Muffinman | last post by:
Hi, I have a webpage with two Iframe's. I want to be able to change the target of all links in one frame so it will point to the other frame and all this from the main page. Is this possible and if so how? Thanks in advance, Maarten
19
2369
by: felixnielsen | last post by:
Some might remember that i, not so long ago, started a treath or two about a weird 3d labyrinth. I now have a working code, that i want to share, hear comments, advice, ect., but first let me explain what its all about. The whole labyrinth is a cubic in its self and it contains x^3 cubic rooms. The labyrinth is infinite/finite, it has no borders, but still have a size. fx. if the size of the labytrint is 2^3 and you find yourself at
1
7625
by: richardscheff | last post by:
Video selector works for IE but not other browsers. for not IE <object ID='Player' data="video/dodgeball.wmv" type="video/x-ms-wmv" width="320" height="280"> <param name="filename" value="video/dodgeball.wmv" /> <param name="ShowControls\" value="1" /> <param name="AutoStart\" value="1" /> <param name="PlayCount\" value="1" />
2
2360
by: dkl1 | last post by:
Hi, I have the following HTML code (for playing a WAV sound file): <OBJECT ID=vidCtrl_success CLASSID="CLSID:05589FA1-C356-11CE-BF01-00AA0055595A" STYLE="display:none" VIEWASTEXT> <PARAM NAME="FileName" VALUE="MySong1.wav"> </OBJECT> I have in the same dir several files, which I named:
2
8087
dream party
by: dream party | last post by:
Inserting a Flash (SWF, FLV) file into HTML web page is already an old and familiar thing to all of us. It is a rather non-flexible thing that just to edit some options in the template. However, I did not understand some parameters totally in the HTML tag. These days when I was surfing the Internet I have found some comprehensive introduction to these two tags. I read it and conclude it with my own words; I think it will be useful to us, so I...
0
9554
marktang
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10136
Oralloy
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9988
jinu1996
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9923
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9811
tracyyun
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8813
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7358
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5266
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2788
bsmnconsultancy
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.