|
Jeslan wrote: Do any of you find Firefox to be the odd one out very often?
No. I develop in FF initially, so code that uses outerHTML never works.
Given that your first technique is essentially just a quick way of re-writing the <input> element, you should be able to accomplish the same thing explicitly using the DOM:
function dofilereset(fileInputId)
{
var f = document.getElementById(fileInputId);
var attrsToCopy = ['type', 'id', 'class', 'style', 'name', 'size', 'title',
'align', 'accept', 'tabindex', 'accesskey'];
var newF = document.createElement("input");
for (var i=0; i<attrsToCopy.length; ++i)
newF.setAttribute(attrsToCopy[i], f.getAttribute(attrsToCopy[i]));
f.parentNode.replaceChild(newF, f);
}
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
I've just received an image for the top banner of a site I'm busy on, and the guy who made it put lots of empty colour on both sides of the main image, so that regardless of screen width, we can always have the main image in the centre, equidistant from the sides. How can I mark up this image to achieve this, if I even can? Right now, as a plain image, it's fully left aligned and is broadening its TD to the right, off the screen. I need want to dynamically always have the centre of the image at the centre of my screen, with both sides cropped.
|
|
|
|
|
CSS:
background-image: url(imageurl);
background-repeat: no-repeat;
background-position: center top;
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
Thanks! I applied that to the TD I was previously using to contain my banner text. I know tables are evil, but we're demoing this tomorrow, and they work for me. Is that acceptable for a prototype, or should I have applied the style to some other element of my table framework?
|
|
|
|
|
Brady Kelly wrote: Is that acceptable for a prototype, or should I have applied the style to some other element of my table framework?
:shrug:
Whatever works. Can't really critique your code 'cause i'm not looking at it.
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
It'll keep us the contract for now, then I can go study up a proper css based three-column layout for production.
|
|
|
|
|
I'm experiencing inconsistent problems with FireBug. Step over + through sometimes work, sometimes just run, 'debugger' stopping execution is a gamble every time, etc.
Am I doing something wrong, or is this just part of the great, random, Javascript adventure?
|
|
|
|
|
Naw, i've had some trouble with it as well; the debugger seems to have some kinks left to be worked out.
One thing that helps sometimes: set up the debugger to be active for the given site, and then open the page in a new tab and debug in that.
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
What version are we supposed to be on? A colleague tells me he found two different ones; the 1.1.0b10, and a later, non-beta one.
|
|
|
|
|
1.2.0bn[^]
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
Thanks. BTW, why do you recommend Venkman and Firebug in your GreaseMonkey article? Is this just for diversity, or are there exclusive features I could use in both.
|
|
|
|
|
Firebug wins out in convenience, but Venkman has traditionally been a much more full-featured debugger. At this point - if you're doing client-side development - it's pretty much a matter of choice; either one will work just fine in most scenarios. I much prefer the recent versions of Firebug, since they do a great job in the UI department while staying out of the way.
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
I'm not sure exactly where to put this, but i've tried just about everything i can think of and find on google over the past few days. I have a webapp that lets you play messages(audio files) that you have recorded or uploaded. i have a main message library and another part of the app that deals with a subset of messages(its been simplified to make it easier to explain). The messages are stored on a different server(50+ gigs of messages preclude storage on the webserver). in the main library you can upload, download, and otherwise create messages which converts them to our format and copies them to or from the storage server. it works perfectly.
the other area that deals with a subset of messages can upload and download files(almost the same code as the library). all are stored on a share accessed via a path in the webconfig \\ip\messages for the library, and the subset is contained in a subdir of messages. when i use a dropdown to choose a message from the library to include in the subset, and attempt to copy \\ip\messages\file1 to \\ip\messages\subDir\file1 it get a network path not found on the source path. this is the same path that is used for the main library(works perfectly). i've gone to each path from the webserver, i've logged in as the limited account IIS is using and gone to each path with no problems, i've even run copy path1 path2 where i copied the exact path from the code which worked perfectly. however when the webapp tries to run the copy it throws the Network Path not found exception.
i would normally assume this was a permission issue, but after the testing i've done i dotn think thats the issue, espically because it works for other parts of the app, just not the pages that deal with the subset of messages. i have checked the paths the code is generating, and have used them to access the files and run the copy from a dos window, under admin and the IUSR account. the code is simply doing a File.Copy(origMsg, outMsg); after it figures out what message should be moved. almost identical logic is used for uploading a message from the users computer. 3 people have gone through this code countless times and havnt found any errors that have fixed our problem... i was hoping some genius out there would be able to give us any insight into why this wont work on one page and not another in the same web app, and they are both part of the same project and compile to the same dll.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi,
I am using ajax in my application.
I want to populate CheckBoxList with ListItem through javascript.
I dont know how to add or delete list Items from CheckBoxList through Javascript.
Can anyone help me on this.
|
|
|
|
|
Hi Guys,
I found a hidden/special character in one of my string variable like this- 

I tried using trim and replace, but it won't work.
I am using asp.net vb coding. And I am not so sure if how can this be removed. Any idea?
hifiger2004
|
|
|
|
|
hifiger2004 wrote: 

That would be a newline (vbLf, Environment.NewLine, etc). They're common as mud.
This one is encoded as a numeric character reference for inclusion in HTML or XML. Which is a bit odd, but not particularly worrying. You should be able to strip it out easily enough.
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
How do I fill a form input type=text from ASP code? I have an input type=text named field1. I coded:
field1.value = "test"
I get an error saying field1 is not an object. How do you do this?
|
|
|
|
|
Do you have runat="server" in your input html?
|
|
|
|
|
No, this is Classic ASP, not ASP.NET.
|
|
|
|
|
Which also runs at the server and would need this attribute...
|
|
|
|
|
I put runat="server" on the input field and changed the id to match the name (fname) but still get the same result:
fname.Value = recordset("fname")
Microsoft VBScript runtime error '800a01a8'
Object required: 'fname'
|
|
|
|
|
I wondered if anyone could help.
I want to write a script in a page to show the days since a certain date (which I would hard code into the script), so for example, on the screen it would show:
"It has been xx days since this event" (where xx is the number of days)
How would I do this, I could imagine it would be quite an easy javascript snipet using the dateadd function but I was not sure and couldnt find much on google to help.
p.s. Currently using HTML on the page but am I write in thinking a snipet can be any language as it is just declared at the top of the snipet and closed at the end?
Thanks
|
|
|
|
|
How 'bout something like this?
function DaysSince(date)
{
var msecPerDay = 1000*60*60*24;
return Math.floor( (Date.now() - date) / msecPerDay );
}
var days = DaysSince( new Date("2/3/2004") );
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
how do i set this up? i want to be able to simply password protect a folder with a simple username and password ... something that takes 2 minutes in apache ... can someone point me the way in IIS7 ... not IIS6 thanks
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
When I created a web application that used Crystal reprots on our development server I moved it to our web server. Now of course crystal reports isnt going to work but how do I copy the libraries over there so they will work? The techs for crystal reports said when I create a development package (setup deployment package in Visual Studio 2008) I need to copy the libraries with them. How exactly do I do this and it all work correctly?
|
|
|
|