|
|
Ok, you killed my boss.Hes still laughing
kagiso
|
|
|
|
|
As lng as he's happy, eh?
Have you actually found an answer to your question...? There are lots of ways of doing it though - it really depends on what sort of thing you want...
Fred
|
|
|
|
|
What are you requirements as far as programming languages? Simply HTML/Java?
You can do a simple google search for a java clock.
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
matjame wrote: clock with date on my web page
function clockTick(){
var currentTime = new Date();
document.getElementById('time').value = " "+currentTime;
document.getElementById('time').blur();
setTimeout("clockTick()", 1000);
} // function clockTick()
clockTick();
|
|
|
|
|
... that the web works at all.
Before reading the following, keep in mind that I'm not very experienced at coding web pages. I come from a C++ background and I like the order and discipline the language imposes on the programmer. When coding web pages, you can pretty much toss all that discipline out the window because it generally doesn't do you any good at all. I hate that. This is more a tale of woe than a question, so just sit back, grab a soda, and laugh along with me.
I've been working on a "classic" ASP web site that combines html, vbscript, css, and javascript. It displays just fine, but the VS2005 IDE indicated several "errors", indicated by the annoying red underscore. Yesterday, I decided to try to bring one of the site's web pages into strict compliance with what the vs2005 IDE thinks is "good form". Everything was going fine until I got to the table cell background image stuff.
The site itself is composed of a frameset, and all of the content is based on a nested table structure. The outermost table on every page is decorated by a series of images that display a graphic frame around the data. Personally, I think the graphic frame eats up way too much screen real estate (and it looks like something a VB programmer would come up with), but (unfortunately) I have not been tasked with eliminating or improving it. The programmer that originally coded the site used the following general table definition to display the border:
<table width="700" cellpadding="0" cellspacing="0" id="table1">
<tr valign="top">
<td width="30" ><img src="img_tl.jpg" alt="" border="0" /></td>
<td width="331"><img src="img_tab.gif" alt="" border="0" /></td>
<td style="background-image:url('img_tm.jpg');background-repeat:repeat-x;" width="100%"></td>
<td width="15" ><img src="img_tr.jpg" alt="" border="0" /></td>
</tr>
<tr>
<td width="30" background="img_sl.jpg"></td>
<td colspan="2" width="100%">
<td width="30" background="img_sr.jpg"></td>
</tr>
<tr>
<td width="30" ><img src="img_bl.jpg"></td>
<td colspan="2" width="662" background="img_bm.jpg"> </td>
<td width="15" ><img src="img_br.jpg"></td>
</tr>
</table>
This displayed just fine, but the IDE complained about the width= and background= elements, so I went about replacing them with appropriate style code in the site's css file. The code shown above now looks like this:
<table width="700" cellpadding="0" cellspacing="0">
<tr>
<td class="BorderBlueTopLeft" > </td>
<td class="BorderBlueTopTab" > </td>
<td class="BorderBlueTopMid" valign="middle"><b>Title</b></td>
<td class="BorderBlueTopRight"> </td>
</tr>
<tr>
<td class="BorderBlueSideLeft"> </td>
<td colspan="2">
<td class="BorderBlueSideRight"> </td>
</tr>
<tr>
<td class="BorderBlueBottomLeft"> </td>
<td class="BorderBlueBottomMid" colspan="2"> </td>
<td class="BorderBlueBottomRight"> </td>
</tr>
</table>
The widths and background images are now specified in the indicated css classes (the widths were dictated by the width of the images, and the repeat stuff was dictated by the intended positioning of the class), and the code is much more readable. The real problems arose after I started plugging the missing code back into the improved general table layout.
Not counting the left/right border columns, the outermost table essentially contained a middle cell (colspan=2) which contained it's own table. That inner table had a single row with two columns, and within each of those columns was an additional inner table. Sprinkled throughout this nested table structure were width specifications for given columns as well as widths for the tables themselves. Believe me when I say it was a mess, and I spent a day trying to figure out why crazy crap was happening all of the page. Apparent gaps between columns, the inner-most tables rendering in varying and bizarre sizes, the graphic borders not showing up or showing up where they shouldn't be.
No, there weren't any open tags. I wasn't missing any quote marks or semi-colons, or any of the typo stuff you normally find after you've been typing too fast for a few hours. I was really struggling, and even a couple of guys in the office that had more experience than me could not get a grip on what was happening. The comedy ensued for several hours as we changed random elements trying to get the tables to display correctly.
This morning, after fighting with it for an hour or so, I decided to try putting a div inside each cell that contained a table, and specifying that the div was 100% of the containing cell size. The table that was contained in the cell was now enclosed by a div . When I ran the page, everything snapped neatly into place, and all is now right with the world.
I'm really surprised that web pages work at all, and that the web hasn't exploded in a spectacular fire ball. It appears as if all standards for coding a web site are merely whispered guidelines that can be used or ignored on a whim. No wonder the browsers are all so big and bloated - they have to allow what amounts to crap to be rendered just as well as the properly formed stuff.
The moral of this story: If you're nesting tables, make sure you enclose each nested table within a div . The div becomes the parent element, and sizes specified in percentages appear to work every time.
Moral #2: Get back to real programming as soon as you can possibly arrange it - this web stuff is nuts.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I shall studioudly ignore you pointed dig at VB programmers....
As a web-programmer I have often been asked to "take over" an old site, and especially where classic ASP is concerned I usually turn such work down, telling the client that it'd be eaier, quicker and cheaper for me to start over from scratch.
One problem is that it's actually so easy to produce "something" that too many peopke do who really shouldn't...
...and the wysiwyg designers, from Dreamweaver down, make this even easier. I refuse to even look at sites (from a coding viewpoint) designed with Dreamweaver, because of just the sort of thing you describe. It's too easy for people who don't know what they're doing to drag and drop tables inside tables inside tanles in a vain attempt to get some structure to their page.
I don't object per se to using tables, in moderation, for layout, but they are a lazy way of doing things.
CSS is supposed to be ending all this. It's a fine idea, but I must say I have "issues" with the way CSS has been implemented. While tables maybe "too easy" it is sometimes just too damn difficult, and takes lines and lines of code (esp if you want to be cross-browser compatible) jsut to achieve what could be done with a few lines of HTML.
Anyway, it's easy to forget that this is still early days... in a decade, in a century, they'll all be shaking their heads and not knowing whether to laugh or cry at our primitive coding/computing efforts...
..and they'll look at C++ code and think "Christ! Did people actually write in that??!!! Why didn't they just tell their computer what they wanted it to do, in plain, BASIC, English...?"
Fred
|
|
|
|
|
John Simmons / outlaw programmer wrote: The site itself is composed of a frameset, and all of the content is based on a nested table structure. The outermost table on every page is decorated by a series of images that display a graphic frame around the data. Personally, I think the graphic frame eats up way too much screen real estate (and it looks like something a VB programmer would come up with), but (unfortunately) I have not been tasked with eliminating or improving it.
So yeah, when did you get stuck maintaining the CodeProject forums...
(but yeah, tables are hell for layout, 'cause they don't really use the same strategy as anything else on a web page. For tabular data, this is just fine, and once in a great while you can make good use of the brain damage for layout... but the rest of the time, well, it's just brain damage. You have my sympathy...)
----
i hope you are feeling sleepy for people not calling you by the same.
--BarnaKol on abusive words
|
|
|
|
|
Using tables to create layouts was a revolution for designing web pages. Suddenly there was a possibility to actually design pages, not just put some text on a page.
Of course using tables for layout was a terrible hack that used the tables for something that they were not at all intended for. This meant that you had to use a lot of code just to make the tables stop behaving as they should and instead behave the way that you wanted. It was still the best way of doing it, but mostly because there were no other way of doing it at all.
That was more than ten years ago.
Now there are alternatives. Using tables for layout is no longer the only way, but for some strange reason there are still people who think that it's the best way.
---
single minded; short sighted; long gone;
|
|
|
|
|
Me sending an web email to other users from xxxx@mycompany.com & mycompany.com is a small bussieness account of yahoo. The problem is that emails are not going into Inbox but reciving in Bulk email folders of all the users .. plz help me out
Sarfaraz
Student University Of Karachi
|
|
|
|
|
Lalafaraz wrote: reciving in Bulk email folders of all the users
Are all these users on the same email service?
Try sending email to someone on a different email service. You can set up test accounts on yahoo, hotmail, gmail, etc. and see if it is a problem with all email services or just one of them.
It could be that the email service recognizes the yahoo email server as an originator of junk mail and filters all mail coming from email accounts there to the bulk folder.
If that is the case than you have been filtered because of what other users of yahoo are doing.
If so you should think of getting another hosting service that is not popular as a source of spam email.
|
|
|
|
|
Can someone show me how to read out the contents of a (Belgian) e-Id Card by a web page ?
I would like to create a website where accounts can be created by entering a e-Id card and pressing 'New account'. The system would automatically fill in the web-form.
Thx in advance.
|
|
|
|
|
Pat Krimson wrote: I would like to create a website where accounts can be created by entering a e-Id card and pressing 'New account'.
Refer to the documentation that comes with the e-Id card reader or contact the e-Id card reader technical support for the specifications of the particular device.
|
|
|
|
|
Can someone let me know what is going on with this statement? I'm new to javascript. I don't understand what's between the quotes.
document.getElementById("<%=imagetag.ClientID %>")
what does <%= mean?
Thanks!
Ian
|
|
|
|
|
Not 100% sure but I have seen this used two ways. One is to do data binding, the other is to find control programmatically. See if that points you in the right direction.
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
|
The <%=...%> tag is a server tag to output a value. It's almost equivalent to <script runat="server">Response.Write(...)</script> .
The ClientID property of a server control contains the id that the control uses for the html element that it renders. When server controls are inside a container (like a user control) the id is prepended with the id of the container to keep it unique in the form. You use the ClientID property to get this generated id.
---
single minded; short sighted; long gone;
|
|
|
|
|
|
that means you are trying to access the server variable on client side.. hope so it will clear the problem
Sarfaraz Nazir
Solution Developer
Accentys Inc
|
|
|
|
|
|
Hi,
I have a web part page with a toolbar webpart and a grid webpart. In the toolbar, I have menu-items to update a field.
For selecting the value of the field I have another asp.net webform which shows the various options in a dropdownlist.
This form has to be a modal form and has to be shown on click the Toolbar menu items. When the user selects an option from the drop-down list and click OK then the option selected has to be
returned to the web-part page from where the webform was shown.
I'm able to do this when I have a Webform and not a sharepoint webpart page as the parent page. When I use a sharepoint web-part page, this doesn't work.
Code Snippet:
grid webpart(in a webpart page):
• Code-behind
void webpart_SetToolbarMenuItemProperties(object sender, SetMenuItemPropertiesEventArgs e)
{
switch (e.MenuItem.MenuItemAOTName.ToLower())
{
case "smmmileadchangestatuspostpone":
e.MenuItem.ClientOnClickScript = "UpdateStatusWindow()" ;
break;
}
}
• Html source
function UpdateStatusWindow()
{
var returnVal = window.showModalDialog('http://localhost/_layouts/ep/smmLeadReasonId.aspx','','dialogWidth:200px;dialogHeight:120px;status:no');
alert (returnVal);
Aasp.net form shown as modal form
• Html source
function Close()
{
window.returnValue = getSelectedReason();
window.close();
}
function getSelectedReason()
{
return form1.ddlUpdateStatus.value;
}
If anyone has some idea why this is not working, please provide your inputs.
Thanks,
Manpreet
|
|
|
|
|
Hello,
I have a 'select' element in the footer of my masterpage. I'm trying to write javascript to assign a handler to the 'onchange' event of the 'select' control. The javascript is as follows:
var selectDisplay = document.getElementById('selectDisplay');<br />
selectDisplay.onchange = function()<br />
{<br />
alert("You did it!");<br />
}
The id of the 'select' element is 'selectDisplay'.
I have found references to issues regarding using getElementById when the element you want is in the masterpage, but have been unable to find a solution.
Any ideas?
Thanks!
Ian
|
|
|
|
|
Mundo Cani wrote: selectDisplay.onchange
Try setting it up something like this:
<title>Untitled
function OptionSelect(){
var sel = document.getElementById("selectDisplay");
for(i = 0; i < sel.length; i++){
if(sel[i].selected){
i ? alert('Option ' + sel.value + ' selected') : alert('Select an Option');
break;
} // if(sel[i].selected)
} // for(i = 0; i < sel.length; i++)
} // OptionSelect()
onchange="OptionSelect();">
Select an Option
Option 1
Option 2
Option 3
Option 4
|
|
|
|
|
JimmyRopes wrote: var sel = document.getElementById("selectDisplay");
Thanks for your reply. Unfortunately, the problem is getElementById does not return an element. I pass it the id of the element I'm looking for (there is no mispelling... I copy/pasted the id) but it is not returned.
Ian
|
|
|
|
|
Mundo Cani wrote: Unfortunately, the problem is getElementById does not return an element.
That is very strange.
As an exercise I just swiped the code in my rely from the <html> to the </html> and put it into a new document in notepad.
I saved the document as test.htm and then clicked on the saved document. A browser window came up and the control worked as intended. I didn't add or take anything away but just used the code posted.
Try it and see if you get the same results.
There is no problem with getElementById. I use it all the time on my web pages.
|
|
|
|