Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Javascript] 'null' jest pusty lub nie jest obiektem
fantek
post
Post #1





Grupa: Zarejestrowani
Postów: 51
Pomógł: 0
Dołączył: 9.10.2010

Ostrzeżenie: (0%)
-----


Witam. Na stronie http://machinesbook.com/beta/user/dashboard w panelu użytkownika mam dodawanie nowych Logbooków itd. Wszystko by było ok ale w IE po kliknięciu na add otwiera mi formularz rejestracyjny zamiast formularz do dodawania logbooków oraz w konsoli wywala mi błąd 'null' jest pusty lub nie jest obiektem (błąd odnosi się do linijki z "gebi('photos').appendChild(d);")


Funkcja w której wywala ten błąd:
  1. function addNewPhoto() {
  2. var max = 7;
  3. var num_img = $('input[name="photos[]"]').size() + $("a.delete").size();
  4. if((max!=0 && num_img<max) || max==0) {
  5. var id = 'p-' + photoIndex++;
  6.  
  7. var i = ce('input');
  8. i.setAttribute('type', 'file');
  9. i.setAttribute('name', 'photos[]');
  10.  
  11. var a = ce('a');
  12. a.style.fontSize = 'x-small';
  13. a.style.paddingLeft = '10px';
  14. a.setAttribute('href', '#');
  15. a.setAttribute('divid', id);
  16. a.onclick = function() { re(this.getAttribute('divid')); return false; }
  17. a.appendChild(document.createTextNode('Remove'));
  18.  
  19. var d = ce('div');
  20. d.setAttribute('id', id);
  21. d.setAttribute('style','padding: 4px 0;')
  22.  
  23. d.appendChild(i);
  24. d.appendChild(a);
  25.  
  26. gebi('photos').appendChild(d);
  27. if( num_img +1 == max){
  28. $('#addPhotoLink').addClass('hide_box');
  29. }
  30.  
  31. } else {
  32. alert('Sorry, you have reached the maximum number of images per listing');
  33. }
  34. }



Czego to wina jak to naprawić ?

Ten post edytował fantek 6.02.2014, 12:00:45
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 06:36