JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 12th, 2004, 08:52 PM
crazycondor crazycondor is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 23 crazycondor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m 50 sec
Reputation Power: 0
Question Add and Delete Objects?

Hello,

Is it possible to add and delete visible objects (such as DIVs) with javascript after the page has load? I want to do this without

reloading the page. In fact i've tried some examples, using the innerHTML inside a DIV and i've created some tables but i don't know

how to delete them. Is innerHTML the right way to do this? And something else. If a delete method exists and i want to delete an

object that contains other objects must i delete them first or i can delete only the parent object?

Thanx.

Reply With Quote
  #2  
Old May 12th, 2004, 09:04 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Posts: 2,056 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 44 m 22 sec
Reputation Power: 0
Using CSS and a lil bit of JS, you can simply set the DIV to display:none;

Reply With Quote
  #3  
Old May 13th, 2004, 07:02 AM
crazycondor crazycondor is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 23 crazycondor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m 50 sec
Reputation Power: 0
Add and Delete objects?

A few days ago i've asked if it is posible to create an MDI form with Javascript. The solution i found was to create an HTA that has two DIVS. The top DIV, that contains the menu (such as explorer) and the main DIV that it initially empty (grey). The whole think looks just like MS Excell with no window open.

What i wanna do is on operators request (according to the button that hits in the menu) to display in the main DIV the "forms", which in fact are draggable iframes. From that point i can think of two solutions. Either to create all the iframes from the beginning with visibility = hidden and change the visibility to visible when the operator hits the respective button, or to create - delete the iframes dynamically. What concerns me most is if the first solution has effect on the memory usage (I don't know really. Maybe my question is silly) because if it has i would prefer to create and delete an iframe every time the operator hits the menu.

What do you think?

By the way whats the difference between visibility:hidden and display:none?

Thanx.

Last edited by stumpy : May 13th, 2004 at 11:25 AM. Reason: Please type your posts normally - do note use unnecessary line-breaks

Reply With Quote
  #4  
Old May 13th, 2004, 11:29 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Posts: 2,056 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 44 m 22 sec
Reputation Power: 0
Display none completely removes the object from the page, whereas hidden keeps it in the page flow, taking up space (text will flow around it).

Your apps sounds overly complicated - such DHTML are usually a real pain to maintain as you struggle with various browser differences and bugs. Then there's the usability issue.

Reply With Quote
  #5  
Old May 13th, 2004, 11:34 AM
crazycondor crazycondor is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 23 crazycondor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m 50 sec
Reputation Power: 0
Add and delete objects


Reply With Quote
  #6  
Old May 13th, 2004, 11:47 AM
crazycondor crazycondor is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 23 crazycondor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m 50 sec
Reputation Power: 0
Sorry about the null message. Wrong button!!

As i told in the previous (non null message) a form cinsists of a DIV that contains two tables. Table-1 represents the title bar

of the form and Table-2 represents the body of the form. Inside Table-2 i have an iframe. Every time i hit the title bar, i

bring that selected form in front of the others. The problem is that i wanna do the same by hitting in the body of the form but the

iframe cannot capture the event onClick. The event is captured if place the onClick function in the <body> of the page that is the

source of the iframe. Can i refer (from this page) to the DIV that contains the whole form, located in the main page?

And by the way, which is the value of the display attribute that makes the form visible?

Reply With Quote
  #7  
Old May 13th, 2004, 09:52 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Posts: 2,056 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 44 m 22 sec
Reputation Power: 0
Please type your posts normally - do note use unnecessary line-breaks!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Add and Delete Objects?


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap