|
The window.event object only exists in Internet Explorer (and perhaps some that tries to emulate it), so this won't work in most browsers. Other brosers send the event objec along as a parameter to the function.
Do you get any error message? Have you enabled Javascript error messages in the browser?
You can use the ClientID property of a control to get the id to use for client script.
---
Year happy = new Year(2007);
|
|
|
|
|
The IE part is fine, this is an internal application and all the computers here run IE. Obviously I would like to make it cross platform if it doesn't take too long, you know deadlines. Is there any easier way to make pressing enter click a button?
|
|
|
|
|
By default, the enter key will activate the first submit button in the form.
---
Year happy = new Year(2007);
|
|
|
|
|
eggsovereasy wrote: Also is there an easier way to refer to runat=server controls in javascript then to go to view source and find the big ugly id that gets generated?
I use the Microsoft IE Developer toolbar. It allows you to select an element and view all it's attributes etc, including ids. It's also got some useful tools, such as a ruler, and a table entity highlighter.
I'd suggest not using the new beta one - there's nothing wrong with it per-se, but it crashes sometimes on my machine, and never stays in the toolbar - have to re-enable it ever time I need it. Unfortunately, I could only find links to the new one. If you can't find it, email me and I'll send you the installer for the old stable one
Firefox also has a (much better) version of the same kinda deal....
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
I think you mean tab control. Now that you know how to spell it, you can use google to find some
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Christian Graus wrote: I think you mean tab control.
Or maybe
"15. to connect into secretly so as to receive the message or signal being transmitted: to tap a telephone wire or telephone." (http://dictionary.reference.com/browse/tap[^])
:->
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
Hi All,
I have to disable right of the Browser.I got the script on net and use that but when I include it in .js file my application doesnot work it shows login screen where right click is disable but when I click login but it doesnt go inside the main page.
Can anyone tell me what is the problem in the script.
Following is the script:
var message="Function Disabled!";
function clickIE4()
{
if (event.button==2)
{
alert(message);
return false;
}
}
function clickNS4(e)
{
if (document.layers||document.getElementById&&!document.all)
{
if (e.which==2||e.which==3)
{
alert(message);
return false;
}
}
}
if (document.layers)
{
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById)
{
document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("return false;")
Thanks in advance.
|
|
|
|
|
varshavmane wrote: I have to disable right of the Browser.
Don't do that. It's petty and annoying.
|
|
|
|
|
I am having a problem in some javascript. I am trying to avoid using a postback to a server to update a dropdownlist box on the client machine. I have already managed to get a new list of items and have them parsing fine on the client machine. The problem though is I cannot find anything on how to delete the current contents and build a new list inside. So here are the two questions:
First what call from javascript would clear the current contents? (I have the control).
Second, do I create new "option" objects assign them the new values and add them to the controls through obj.options.add() or something else?
And finally, does there need to be some sort of refresh to the control to view when it opens next.
Final note: this needs to work with both IE 6+ and Firefox (latest version).
Thanks,
Leo T. Smith
|
|
|
|
|
Set the controls innerHtml to "", that will delete everything inside it.
Leo Smith wrote: Second, do I create new "option" objects assign them the new values and add them to the controls through obj.options.add() or something else?
That seems reasonable, yes.
Leo Smith wrote: And finally, does there need to be some sort of refresh to the control to view when it opens next.
I don't believe so
Leo Smith wrote: Final note: this needs to work with both IE 6+ and Firefox (latest version).
I think all the functionality you're talking about has been around for some time.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
It does not seem to work. Here is the code. What am I missing. It doesn't clear the list (I tried commenting out the loop that adds to the list) and doesn't add anything to the list either. By the way, this is the last step in the calling function.
function RefreshComboList(sList,sElement, iID)
{
var cbList = document.getElementById(sElement);
// Test to make sure that cbList is the desired control and refresh values
// are correct
alert("Selected ID - " + cbList.options[cbList.selectedIndex].value +
"\n\n" + sList);
cbList.innerHtml=""; // Clear list
var rows = sList.split("||"); // split list into rows
// Loop through rows to load combobox
// Last result is empty
for(var i=0; i< rows.length - 1; i++)
{
var cols = rows[i].split("|"); // split into columns
var opt = document.createElement("option"); // Create new list item
opt.value = cols[1]; // Set value for list item
opt.innerText = cols[0]; // Set the view text for list item
cbList.appendChild(opt); // Add list item to DropDownList
}
}
Thanks,
Leo T. Smith
|
|
|
|
|
Here's something ripped from our app - seems to work fine...
var theDdl = $('ddlName);
var options = theDdl.options;
for (var i=theDdl.length; i>-1; i--)
{
//theDdl.remove (i);
theDdl.options[i] = null;
}
//Now add the new items
for (i=0; i< theList.length; i++)
{
var opt = new Option();
opt.value = theList.someValue;
opt.text = theList.someText;
try
{
theDdl.add(opt,null); // standards compliant apparently
}
catch(ex)
{
theDdl.add(opt); // IE only
}
}
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Thanks, I'll give it a try.
Leo T. Smith
|
|
|
|
|
Does anyone here have experience creating Firefox extensions? I need help getting started, and the documentation at the mozilla site just leaves me unfulfilled.
Thanks,
Rich
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
I want to use an activex control in a html page on my computer, not for the web, but it won't load the activex control unless I make the file an .HTA file. Dam it its my computer and i want it to run in as .HTML !(for other reasons)
What security settings must i change to allow it to run under .HTML...clicking allow activex control warning in ie does not make a difference......change registry settings for thumbCtl? safe for scripting? how please???
<object classid="clsid:1d2b4f40-1f10-11d1-9e88-00c04fdcab92"
onmouseover="this.displayFile('C:\\WINDOWS\\Web\\Wallpaper\\Autumn.jpg');"
onmouseout="this.displayFile('C:\\WINDOWS\\Web\\Wallpaper\\Bliss.bmp');"
id="Thumbnail" width="120" height="115/">
Set mythumb=document.all.Thumbnail
'Set mythumb = CreateObject("thumbCtl.thumbCtl.2")
mythumb.displayFile( "C:\WINDOWS\Web\Wallpaper\Bliss.bmp" )
|
|
|
|
|
"removed" was "onmouseover" and "onmouseout" the words were automatically removed by
|
|
|
|
|
Right, so I have a file in a directory that is being served by a vhost that has a query string in its filename, e.g. root/dir1/dir2/myfile.html?query=1&string=2.
When I try the URL, including the query string, Apache is trying to find the file minus the query string (obviously to then send the query string into whatever can handle it inside the file.) So Apache is looking for root/dir1/dir2/myfile.html which doesn't exist.
How do I tell Apache to be stupid and to ignore query strings?
regards,
Paul Watson
Ireland & South Africa
Shog9 wrote: I don't see it happening, at least not until it becomes pointless.
|
|
|
|
|
I may be wrong but the processing of a querying string is basic behavior for any web server. You can turn off GET processing for a particular web application scope via the web server's configuration. Unfortunately, I know how to do this with IIS but not with Apache.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Thanks George. In this setup I really just want Apache to serve files even if they have ? in the filename. It is for a spidered/saved website on disk.
regards,
Paul Watson
Ireland & South Africa
Shog9 wrote: I don't see it happening, at least not until it becomes pointless.
|
|
|
|
|
why would you do that anyway?
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
We have a demo coming up and need to wget a couple of websites onto a laptop. Apache is serving up the static files but doesn't like finding files with querystrings in the filename.
regards,
Paul Watson
Ireland & South Africa
Shog9 wrote: I don't see it happening, at least not until it becomes pointless.
|
|
|
|
|
Perhaps mod rewrite?
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
Yeah, it might be configurable that way but I haven't found out how yet. A co-worker keeps repeating to me "Paul, it is a fundamental part of web-servers, only crazy people want to turn it off so it probably isn't an easy setting."
So we've gone with rewriting the links and filenames rather.
regards,
Paul Watson
Ireland & South Africa
Shog9 wrote: I don't see it happening, at least not until it becomes pointless.
|
|
|
|
|
Paul Watson wrote: So we've gone with rewriting the links and filenames rather.
I was going to suggest making your own mock web server... but i guess that is useless now.
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
I'm looking for a web site that does extreme things with JavaScript to test some code in an embedded browser designed to defeat that. (This would include things like resizing the browser, doing popups, etc.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|