The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
javascript hide problem
i've made an ajax profileditor
http://www.ragtek.org/tutorials/editor.htm the fields are coded like this: HTML Code:
<div class="smallfont"><span id="usertitle">test</span></div>Einladungen: <span id="einladungen">200</span> but for usertitle im getting this error: Quote:
usertitle.style.display = 'none'; is working, usertitle.innerHTML = xml_sender.fetch_data(fetch_tags(xml_sender.handle r.responseXML, 'linkhtml')[0]); is also working, but usertitle.style.display = ''; isn't working the fields are updated, just the showpart isn't working :/ |
#2
|
||||
|
||||
You can try
Code:
usertitle.style.display = 'inline'; // or usertitle.style.display = 'block'; |
#3
|
|||
|
|||
hi
thx for answer i don't know as i said its the same function as my edit edit() is working edittitle() not http://www.ragtek.org/forum/clientscript/profilajax.js |
#4
|
||||
|
||||
Could there be a problem with using the same global variable inputobj in both functions? Try declaring them as local variable in the functions with var inputobj = 'xxxx';
|
#5
|
|||
|
|||
i changed it=> same error
i think i'm missing something |
#6
|
||||
|
||||
Add some debugging stuff:
Code:
function savetitle(){ if (editstate==true){ if (xml_sender.handler.readyState == 4 && xml_sender.handler.status == 200) { if (xml_sender.handler.responseXML) { alert(usertitle); // should say HTML object or somthing usertitle.innerHTML = xml_sender.fetch_data(fetch_tags(xml_sender.handler.responseXML, 'linkhtml')[0]); container1.removeChild(editobj); alert(usertitle.innerHTML); alert(usertitle.style); alert(usertitle.style.display); usertitle.style.display = 'block'; editstate=false; } } } } |
#7
|
|||
|
|||
1. alert= my input
2,3 => undefined --------------- Added [DATE]1195581708[/DATE] at [TIME]1195581708[/TIME] --------------- problem solved i used a wrong variable so usertitle was the object + the input shame on me |
#8
|
||||
|
||||
Good.
A suggestion also for you. You can make your edit, presave & save functions more generic, or even encapsulate them in an object, so you can reuse the same code for each of your fields Einladung, title etc. |
#9
|
|||
|
|||
hi
thx 4 the tipp, (i wanted to make it with objects) but atm i don't realy understand the oop part :/ i can use it by copy & paste ( i'm doing it for my ajax prefix addon http://www.ragtek.org/tutorials/select.htm ) but one thing is just copy,paste and change the objects and the other thing is to realy understand it and to use it by own things |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|