|
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
|
|
|
|
|
Joe Woodbury wrote: (This would include things like resizing the browser, doing popups, etc.)
That's not really anything extreme, more like basic Javascript.
Joe Woodbury wrote: 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.
Not sure about sites that do extreme things, but here are some pretty cool ones:
Javasript Source
Javascript Kit
They're both really good. Hope this is what you need.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
|
Hello:
I am having problem of Request.queryString("address") to get the value of address, if the address contains '#' character then it is chopping up to # then I am not getting remaining part of value and other values in the query string.
My query sting is:
a href="TestCharacterForm2.aspx?Address=Apt#123&Address2=Chicago" mce_href="TestCharacterForm2.aspx?Address=Apt#123&Address2=Chicago" > TestCharacter
Is there any way using javascript or something else?
Thanks
fireman
|
|
|
|
|
The reason for this is that it is going to go to the page "TestCharacterForm2.aspx?Address=Apt" and then go to the page jump 123&Address2=Chicago. You could try "URL encoding" it.
This would give it a value of "%23" in the link but # on the server.
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
The problem is what Brad suspected. You haven't url encoded the url properly. Also, you haven't html encoded the property either.
Your code should look like this:
href="TestCharacterForm2.aspx?Address=Apt%23123&Address2=Chicago"
Note that the # character is url encoded into %23, and that the & character is html encoded into &
If you are writing the values in the querystring from server code, use the methods Server.UrlEncode to encode the query string values, and Server.HtmlEncode to encode the entire property value.
---
Year happy = new Year(2007);
|
|
|
|
|
sorry just to correct you answer, HTML entities are not accepted as URL components.the "&s;" would mean that there would by a query stringAddress=Apt%23123 and a seperate on called amp;Address2=Chicago.
A quick was to get the URL values is to download the firefox extension "Hack Bar". Quite usefull (https://addons.mozilla.org/firefox/3899/[^])
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
Bradml wrote: sorry just to correct you answer
You can't. It's already correct.
Bradml wrote: HTML entities are not accepted as URL components.
Of course not. The HTML entities are not encoded in the URL, they are encoded in the HTML code. When the HTML entities have been decoded to get the value of the HTML property, you get the URL.
---
Year happy = new Year(2007);
|
|
|
|