473,654 Members | 3,084 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Href and onClick?

I have a Flash based video player that uses a javaScript function on the
page to modify variables within the Flash. This is so, external, jpg,
thumbnails can change the video without reloading the page. This works great
using:

<a href="javascrip t:changeVideo(' videoName.flv') "><img
src="thumbname. jpg"></a>

Now, my client wants to be able to track which videos are watched by calling
a cgi script she has in place. I've been trying all morning to come up with
something so I can call my current changeVideo() function, and also post a
variable to a cgi.

<a href="javascrip t:changeVideo(' videoName.flv') "
onClick="myTrac ker('videoName. flv');"><img src="thumbname. jpg"></a>

Then, within myTracker I am trying to submit a form with a hidden field...
it does work, except when I submit the form I redirect to the url I am
calling. I need to 'silently' post the form data.

function myTracker(vname ){
//set form value
document.hidden Video.vname.val ue=vname;
document.hidden Video.submit();
}

--
Dave -
Adobe Community Expert
www.blurredistinction.com
http://www.macromedia.com/support/fo...am_macromedia/
May 24 '06 #1
6 1874
You could use a hidden frame to submit to the Cgi page so that the user
never sees it...

May 24 '06 #2
> I've been trying all morning to come up with
something so I can call my current changeVideo() function, and also post a
variable to a cgi.


You have two choices:
- You can use AJAX
- You can use a Iframe

I would choose to use AJAX personally since it's so lightweight
Make sure you choose to post and not get.
Here is an example
http://www.yourhtmlsource.com/javascript/ajax.html

May 24 '06 #3
ma**********@gm ail.com said the following on 5/24/2006 3:32 PM:
I've been trying all morning to come up with
something so I can call my current changeVideo() function, and also post a
variable to a cgi.
You have two choices:


There are more than that.
- You can use AJAX
- You can use a Iframe
3) Use a process a lot more reliable - set the .src property of an image
to the cgi script.

<URL: http://jibbering.com/faq/#FAQ4_34>

Title of that entry in the group FAQ?

4.34 How do I run a server side script?
I would choose to use AJAX personally since it's so lightweight
Then you would choose the worst way of doing it.
Make sure you choose to post and not get.
With the FAQ answer using an image, you don't have to do either.
Here is an example
http://www.yourhtmlsource.com/javascript/ajax.html


Irrelevant and useless to the OP's question.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 24 '06 #4
Thanks for all the help! I ended up going with a hidden iframe which seems
to work. Are there any issues with that? I see Randy said setting the SRC
property of an image is more reliable. Wondering why.

--
Dave -
Adobe Community Expert
www.blurredistinction.com
http://www.macromedia.com/support/fo...am_macromedia/
May 25 '06 #5
Dave Mennenoh said the following on 5/25/2006 8:41 AM:
Thanks for all the help!
And thank you for quoting what you are replying to next time.

If you want to post a followup via groups.google.c om, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.

<URL: http://www.safalra.com/special/googlegroupsreply/ >
I ended up going with a hidden iframe which seems to work.
Yes, hidden IFrame's have been used for years.
Are there any issues with that?
Not really. Most browsers support it enough that it isn't an issue.
I see Randy said setting the SRC property of an image is more reliable.
Wondering why.


Only because more browsers support image src setting than IFrame's. And
the history trail issue when it comes to Frames and IFrames. If you need
to transmit a lot of data then the hidden iframe is the way to go. If
the only thing you need to do is trigger a server side script, then
setting the .src property of a hidden image is simpler, doesn't mess
with the History trail, and is very very widely supported. It is, by
far, the best way to do it. And that reliability is precisely why the
FAQ entry on this issue uses that method.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 25 '06 #6
>>If you want to post a followup via groups.google.c om...

Thanks, but I use OE's news reader.
And that reliability is precisely why the FAQ entry on this issue uses
that method.


If i have issues with the iframe I'll check that out.
--
Dave -
Adobe Community Expert
www.blurredistinction.com
http://www.macromedia.com/support/fo...am_macromedia/
May 25 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
167416
by: Jez | last post by:
Hi, I've created a function which opens a popup window containing a calendar. When a day is clicked, the date is entered into a text box on the parent page and the popup is closed. The link I'm using on the parent page is ... <a href="#" onClick="popupcal()">choose date</a>
11
2008
by: Dana Smith | last post by:
Can anybody explain why when I have a hyperlink on a page with the code similar to below, after the user clicks on the link, the desired window opens but the page with the hyperlink changes to a new page with simply the value "" on it? I want the original page to remain unchanged.... thanks for the insight to a javascript n00bie... :) <a href="javascript:window.open('wireless.htm', 'pjtdetails', config='height=400, width=400, toolbar=no,...
14
2495
by: Brandon Hoppe | last post by:
I'm trying to change the src of an ilayer in the parent document from a link inside the ilayer. I'm not able to get it to work. All that happens is Netscape 4 crashes. This is for Netscape 4 only. For example, here is the main page: <html> <head> <script type="text/javascript">
5
10871
by: Mike | last post by:
In my previous post, I wrote: > ... > GOAL: (very simple) Provide a hyperlink which, when clicked, > calls a javascript function which opens a new URL. > ... > PROBLEM: The following code works fine if I click to open in > the same window, but if I click the browser option to open in a > new window, the new window tries to open the href URL (the > onClick function does get executed, but seems to be ignored). > ...
2
9157
by: Kevin Lyons | last post by:
Hello, Can anyone assist me with what I am trying to do with the following code (six different scenarios to try to make the functionality work correctly)? I want to always (and ONLY) display in the status bar 'Symantec Corporation' whenever anyone mouses over (onMouseOver) my image or link OR when one clicks while holding the left mouse down (onClick) on the same image or link. Upon releasing the mouse (onMouseOut), the
4
26646
by: Jamie Jackson | last post by:
I know that it's possible to return false in an onClick to disable a link. Is there a way to do this within the HREF attribute? Something like: <a href="javascript: return false;"> ? Thanks, Jamie
4
16417
by: Jerry Sievers | last post by:
JS Programmers, "I'm a server-side coder PHP, Postgres etc... My question; Given the following anchor <a href="http://www.somesite.com/somefile.html">link text</a> Is there a way to code an onClick event to call a script and pass the href URL and link text? That is; We'd like to put an identical piece of JS code into each
53
81708
by: usenet | last post by:
See <ul> <li><a name="link1" onClick="alert(this.name);return false;" href="#">Link1</a></li> <li><a name="link2" href="javascript:alert(this);">Link2</a></li> <li>Item 3</li> </ul> Clicking on the first list item gives me "link1" because "this" refers
13
2523
by: Logos | last post by:
There seems to be a serious difference between how FF an IE handle an anchor with an href containing a # and an onclick event. If the onclick event returns false, IE does not change window.location.href to include the #. FF does. (eg) <a href="#moo" onclick="alert('moo'); return false;"> After clicking in IE, location bar in browser shows "www.moo.cow/index.htm". After clicking in FF, location bar in browser shows
5
8672
by: dangt85 | last post by:
Hello, I have the following page: ... <style type="text/css"> body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }
0
8376
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
8290
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8489
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
8594
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...
1
6161
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
5622
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2716
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1596
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.