|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Hii,
I am trying to parse the innerHTML from a treeview like this... //InnerHTML = "<INPUT id=TreeViewPR1_TreeView1n14CheckBox title=Hostage type=checkbox CHECKED name=TreeViewPR1_TreeView1n14CheckBox> //<SPAN class=\"TreeViewPR1_TreeView1_0 TreeViewPR1_TreeView1_1\" id=TreeViewPR1_TreeView1t14 title='Extract This string'>Hostage</SPAN>" function AddNodeid(InnerHTML) { var TitleIndex=InnerHTML.lastIndexOf("title="); if (TitleIndex > 0) { var SubString= InnerHTML.substring(TitleIndex+6, InnerHTML.length+1); var EndIndex=SubString.indexOf("id="); // For Firefox if(EndIndex <=0) EndIndex=SubString.indexOf(">"); // For IE var Nodeid=SubString.substring(0, EndIndex); alert(Nodeid); } else alert("No NodeId"); } the problems are becoz of browsers.. Firefox interchanges the positions of title and id in tag... and another prob with this code is that IE returns id without quotes( i.e 01) but FF returnsin double quotes(i.e "01"). can you tell why this happens and is there a way by which I can directly get title, value pair. Cheerio Abhishek |
|
#2
|
|||
|
|||
|
What are you trying to achieve? I think there is a probably a better way to do it than by using innerHTML.
P.S. Please read Guidelines and Suggestions for Posting on Web Development Forums. |
|
#3
|
|||
|
|||
|
Sorry for not telling this before, actually i am accessing innerHTML like this
for a treeview control in asp.net.. AddNodeid(event.srcElement.parentNode.innerHTML); correct you are we can access title directly by- event.srcElement.nextSibling.title can you tell me various differnces between FF and IE, like tag's they support.. Cheerio Abhishek |
|
#4
|
|||
|
|||
|
Quote:
That's a long list. Can you be more specific? Perhaps these will help: http://www.blooberry.com/indexdot/html/index.html http://en.wikipedia.org/wiki/Compar...ines_%28HTML%29 http://www.webdevout.net/browser_support.php#html http://www.csscreator.com/attributes/ Index DOT Css: The Advanced CSS Reference Wikipedia -- Comparison of layout engines (CSS) http://www.stylegala.com/features/css-reference/ WestCiv :: CSS Browser Support Web Browser CSS Support Table - Web Devout |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Need Help - problem with browsers while parsing innerHTML at clientside |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|