Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÍêÉÆ×Ô¼ºµÄhtml parse

       ˵À´²ÑÀ¢£¬ÎÒ·¢ÏÖ×Ô¼ºÐ´µÄÄǸöhtml parse¹ýÓÚÀíÏ뻯£¬½âÎöxml»¹²î²»¶à£¬Ïë½âÎöÏÖ½ñµÄhtml£¬¹À¼ÆÊDz»´ó¿ÉÄܵģ¬ËùÒÔÎÒ°Ñ´úÂëÖØÐ´ÁËÒ»±é£¬Êý¾Ý½á¹¹¸Ä³ÉË«ÏòÁ´±í£¬ÕâÑù½âÎöËٶȸü¿ì£¬×î´ó³Ì¶ÈµØ¶Ôhtml½øÐÐÈÝ´í´¦Àí£¬ÊÔÑéʱ·¢ÏÖµÄÈ·¿ÉÒÔ½âÎöÆÕͨhtml×Ö·û´®£¬²»ÐèÒªÔÙÑϸñ·ûºÏÄǸöxhtml±ê×¼ÁË¡£¶øÇÒÔÚÁ´Ê½µ÷ÓõĴ«µÝ²ÎÊýÉϲ»ÐèÒªÔÙ´«ÈëdomÀàÐ͵IJÎÊý£¬ÕâÑùдÆðÀ´¾Í¸ü¼Ó¼ò±ãÁË¡£
        ºÃÁË£¬·Ï»°²»¶à˵£¬¿´´úÂ룺
#include<iostream>
using namespace std;
class node;
class dom;
class nodecollect{
private:
 node *n;
 int length;
public:
 nodecollect();
 ~nodecollect();
    int getlength();
 void add(node *nn);
 node* item(int i);
};
class node{
private:
 int start;
 int len;
 char name[20];
public:
 char* nodehtml();
 char* innerhtml();
 char* outerhtml();
 char* innertext();
 char* getattr(char* str);
 char* tagname();
 void setname(char *str);
 node* getparent();
 nodecollect* getchild(); 
 node* getnext();
 node* getprevious();
 node *next;
 node *previous;
 void setstart(int i);
 void setlen(int i);
 int getstart();
 int getlen();
 dom *d;
};
class dom{
private:
 char *text;
 node *start;
 node *end;
 int count;
 int parse(char *s);
public:
 ~dom();
 char *gettext();
 void load(char *str);
 node* getitem(int i);
 int getcount();
 node *getbyid(char* id);
 nodecollect* getbytagname(char *tagname);
};
void dom::load(char* str){
 start=0;
 end=0;
 count=0;
 int l=strlen(str);
 text=new char[l+1];
 strcpy(text,str);
 char *t=text;
 parse(t);
 
}
int dom::getcount(){
 return count;
}
char *dom::gettext(){
 return text;
}
node* dom::getitem(int i){
 node* n1=start;
 while(i--){
&


Ïà¹ØÎĵµ£º

ÓÃ"blog_backup"µ¼³öµÄhtmlÎļþ£¬Õ³Ìùµ½CSDN×¢Òâ

CSDN²©¿Í£ºhttp://writeblog.csdn.net/PostList.aspx
·½·¨Ò»£ºÓüÇʱ¾´ò¿ªindex.htm£¬Ìæ»»£º10pt ---> 12pt£¬±£´æºó£¬ÓÃIE´ò¿ª´Ëhtm£¬ctrl+a--ctrl+c£¬Õ³Ìùµ½²©¿Í¾ÍÐÐÁË£¡
·½·¨¶þ£ºÔÚcsdn·¢±íÎÄÕÂʱ£¬Ñ¡Ôñ¡¾Í¼Ïñ¡¿ºóÃæµÄ¡¾HTML¡¿°´Å¥£¬ÔÙ°Ñindex.htmÔ´ÂëÕ³ÌùÉÏÈ¥£¬Ê²Ã´Ò²²»ÓøĶ¯£¡ ......

HTMLÔªËØ¼°¿Ø¼þʼþÒ»ÀÀ±í


HTMLÔªËØ¼°¿Ø¼þʼþÒ»ÀÀ±í
Ò»°ãʼþ
ʼþ
ä¯ÀÀÆ÷Ö§³Ö
ÃèÊö
onClick
HTML: 2 | 3 | 3.2 | 4
Browser: IE3 | N2 | O3
Êó±êµã»÷ʼþ£¬¶àÓÃÔÚij¸ö¶ÔÏó¿ØÖƵķ¶Î§ÄÚµÄÊó±êµã»÷
onDblClick
HTML: 2 | 3 | 3.2 | 4
Browser: IE4 | N4 | O
Êó±êË«»÷ʼþ
onMouseDown
HTML: 2 | 3 | 3.2 | 4
Browser: IE4 | N4 ......

HTMLС¼¼ÇÉ

ģ̬¶Ô»°¿òµã»÷Á´½Ó²»´ò¿ªÐ´°¿Ú
·½·¨1£º  
  ÔÚģ̬´°¿ÚÒ³ÃæÀï¼ÓÉÏ£º  
  <head>  
  <base   target=_self   >  
  </head>  
  ''<base   target=_self   >  ''·Åµ½<head>±êÇ©ÄÚ
 ·½· ......

html »ñµÃä¯ÀÀÆ÷¸ß¶È

ÓÐÊ±Ò³ÃæÐèÒª»ñµÃÓû§ä¯ÀÀÆ÷µÄ¸ß¶È²ÅÄÜÈ·¶¨ÄÚÈÝÏÔʾÔÚÄÄÀ´úÂë
<div style="position:absolute; left:0; top:expression(document.body.clientHeight/2-document.body.clientHeight/4)">
</div>
ÖУ¬expression(document.body.clientHeight/2)¼´Îª»ñµÃä¯ÀÀÆ÷¸ß¶ÈÔÙ³ýÒÔ2 ......

ÔÚwinformÖнâÎöhtml±êÇ©

  ×î½üÔÚŪ¹«Ë¾µÄϵͳʱÓöµ½Ò»¸öÎÊÌ⣬ÓÐÒ»¸öwinformÒªµ÷ÓÃÍøÕ¾µÄÊý¾Ý¿â£¬Êý¾Ý¿âÖдæµÄÊǾ­¹ýeWebEditor´¦Àí¹ýµÄÎÄÕ£¬¶¼´øÓÐhtml±êÇ©£¬µ±Ê±ÏëÓÃÕýÔò±í´ïʽ¹ýÂ˵ô£¬µ«ÊÇ»¹ÊÇ·ÅÆúÁËÔ­ÒòÓÐÈý£º1.ÎÒ¶ÔÕýÔò±í´ïʽÁ˽âºÜÉÙ£»2.Ëä˵ÎÒ¿ÉÒÔÏÖѧÕýÔò±í´ïʽ£¬µ«ÊÇʵÏÖÆðÀ´Ò²ÊǺÜÂé·³µÄ£»3.Èç¹û¹ýÂ˵ôµÄ»°ÎÄÕµĸñʽ¾ÍûÓÐÁË¡£ÓÚ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ