Jump to content

meomike2000

Members
  • Posts

    171
  • Joined

  • Last visited

    Never

Posts posted by meomike2000

  1. i as well have had much frustration trying to put things in a frame/iframe using ie, always works fine in fire fox....

     

    todate, nobody here has been able to help me with a very similar problem, my solution was to change the frame/iframe to a div........

     

    hope this helps,

    mike.....

     

     

  2. i have set

    var body = document.getElementById('body');
    

     

    that is why i refer to it as body....

     

    i have tried this as well

     

    body.sytle.background = null;
    

     

    and that fails as well.....

     

    the problem is not setting or changing the background color,

    the problem is i let user choose to set a background color or a background image.

     

    both work fine except that after if a uset sets a background color then tries to set a background image it will not show the image, just the set color or just a white background.

    if the image is set or set before a color all is good.

    this problem only exist in ie......

     

    thanks mike.

     

  3. i need to find a way to unset  the background color.

     

    that said i have a script that does just that fine in firefox.

    you can set a background image, or you can set a background color and hide the background image.

    the problem is when i try to show the background image again.

     

    this works fine in firefox,  i use this;

     background.style.color = ' '; 

     

    i tried making the seting to transparent as well.....

     

    this dont work in Internet Explorer, i find that after setting body.style.background = 'what ever color'; ,

    i need to remove this body attribute but cant seem to find a way.

    can anybody help.....

     

    thanks in advance mike.....

     

     

  4. i need to be able to get the height of a div....

     

    i dont want to specify the height of the div due to the fact that as things get added to it the height will change...

     

    the width is specifed....

     

    i tried some thing like this,

     

    var hheight = hiddendiv.style.height;
    

     

    but it will only return the value that i pre set for the div.....

    if i dont set a height it returns blank or undefined.....

     

    any help would be great,

    thanks in advance mike.......

  5. ok i solved the problem, what i did was split the string at the \n. then i replaced all the \n with a div tag and that fixed the problem for me...

     

    also on the lines where there was no text i had to set the div height...

     

    i also have this set so that when you click on a post you can then click edit and it will then strip all the div. and replace them with \n so that it will display correctly inside a textbox.....

     

    thanks to all that looked.......

     

    here is how i add the div tags....

    var newpost = post.split('\n');
    for ( var b = 0; b < newpost.length; b++) {
    	var postdiv = document.createElement('div');
    	if (newpost[b] == '') {
    		postdiv.style.height = '10px';
    	}
    	postdiv.appendChild(document.createTextNode(newpost[b]));
    	//mbpost.appendChild(document.createTextNode(newpost));
    	mbpost.appendChild(postdiv);
    }

     

    and how i strip them....

    var splitpost = mbpost.innerHTML.split('</div>');
    var postinfo = mbpost.innerHTML;
    for (var c = 0; c < splitpost.length; c++) {
    postinfo = postinfo.replace('<div>','').replace('<div style="height: 10px;">','').replace('</div>','\n');
    }
    

  6. in my script i turn a string that was entered into a textbox in to a textnode with js.....

     

    my problem is when i dispaly that textnode al the returns or \n s are ignored......

     

    so if i had this in the textbox input:

     

    test.....

     

    test2....

     

    when i display that with the js it comes out like this

     

    test.....test2.....

     

    i have tried to use replace('\n', '<br />'); but now it looks like this:

     

    test.....<br />test2.....

     

    can anybody help please........

  7. in my script i create an iframe , then the script uses user input to fill a div tag inside the body tag of the iframe src page. this works fine on my ubuntu machine using firefox browser, but will not work on my windows machine using ie,

     

    can somebody please show me or point me to some info on how to make this work for the ie browser.....

     

    this is a sample of my code were the frame gets created.......

     

                   var fdmessarea = document.createElement('iframe');
    	fdmessarea.id = 'messengerframe' + id;
    	fdmessarea.name = 'messengerframe' + id;
    	fdmessarea.className = 'fdmessarea';
    	fdmessarea.width = '197px';
    	fdmessarea.height = '180px';
    	//fdmessarea.src = 'scripts/getimessages.php?uid=' + uid + '&fid=' + id;
    	var date = new Date();
    	fdmessarea.src = 'scripts/messengerframe.php?uid=' + uid + '&fid=' + id    +             '&date=' + date;	
    
    

     

    and how the frame is populated, only works in my firefox....

    i am sure the problem is here var frame = ???

    but not sure how this should be to work in ie.....

    var frame = parent.frames[0].document.getElementById('messengerbody' + id);
    if (frame.firstChild) {
         //alert('insertmessengerwithfirstchild');
    var fChild = frame.firstChild;
    frame.insertBefore(messagediv,fChild);
    }else{
    //alert('insertmessengerwithoutfirstchild');
    frame.appendChild(messagediv);
    //alert('insertmessengerwithoutfirstchildafter');
    }
    

     

    thanks in advance mike....

  8. i need to create or find an image uploader that i can add to a site that uses pictures.

    i know how to upload files with php........

    what i would like to have is one that would let me see all the pictures in a folder on my personal machine(the user) so that i can select the ones that i would like to upload....

    what would be the best recommendation on something like that........

    js, ajax, flash....... and where could i find some info on the subject.....

    thanks mike.....

  9. can somebody please give me an example parser for this xml document, or lead me to a similar example that i can learn off of.

     

    thanks in advance mike.....

     

    header("Content-Type: text/xml")

    <post>

    <type>'.$type.'</type>

    <commentid>'.$commentid.'</commentid>

    <private>'.$privacy.'</private>

    <name>'.$name.'</name>

    <comment>'.$comment.'</comment>

    <friendid>'.$friendid.'</friendid>

    <senderpic>'.$senderpic.'</senderpic>

    <toppic>'.$toppic.'</toppic>

    <mess>'.$mess.'</mess>

    <date>'.$date.'</date>

    </post>

     

    i do not understand how to create the parser, and i can not find a good example

  10. here is a little about my problem....

     

    i have an ajax script that gets a row count from my sql by userid and then checks the row count again after about a min or so....

    the ajax uses a get to get the count from a php script.

    when the row count is returned to the ajax script i can print it out on the screen, but if i try to do something like self.count = 0 and then do something like self.count += 1,

    if i then print that again it doesnt print out a 1 it prints out 01.....

    i tried parseInt(self.count)...... but that fails.....  help please......

    mike

     

     

  11. well i did a little research and found a hidden iframe method where you can target the iframe that is hidden on the page ....

     

    so now the script looks like this and it seems to work.......

    var formtag = document.createElement('form');
    	formtag.enctype = 'multipart/form-data';
    	formtag.method = 'post';
    	formtag.action = 'scripts/uploadsinglephoto.php?uid=' + self.uid;
    	//formtag.type = 'multipart/form-data';
    	formtag.id = 'uploadform';
    	formtag.className = 'uploadform';
    	//formtag.onsubmit = function() { return false; }
    
    	var upfolderinput = document.createElement('input');
    	upfolderinput.id = 'upfolderinput';
    	//upfolderinput.name = 'upfolderinput';
    	upfolderinput.className = 'upfolderinput';
    	upfolderinput.value = '       create new folder(up to 30 characters)';
    	upfolderinput.onclick = function() {upfolderinput.value = '';uploadselect.disabled = true;uploadinput.disabled = false;}
    
    	var uploadselect = document.createElement('select');
    	uploadselect.multiple = false;
    	uploadselect.name = 'uploadselect';
    	uploadselect.id = 'uploadselect';
    	uploadselect.className = 'uploadselect';
    	uploadselect.onclick = function() {upfolderinput.disabled = true;uploadinput.disabled = false;}		
    	for (var i = 0; i < (folders.length - 1); i++) {
    		var y=document.createElement('option');
    		y.text=folders[i];
    		try
    		  {
    		  uploadselect.add(y,null); // standards compliant
    		  }
    		catch(ex)
    		  {
    		  uploadselect.add(y); // IE only
    		  }
    	}
    
    	var uploadnewfolderDiv = document.createElement('div');
    	uploadnewfolderDiv.id = 'uploadnewfolderDiv';
    	uploadnewfolderDiv.className = 'uploadnewfolderDiv';
    
    	formtag.appendChild(document.createTextNode('first'));
    	formtag.appendChild(document.createElement('br'));		
    	formtag.appendChild(upfolderinput);
    	formtag.appendChild(document.createElement('br')); 
    	formtag.appendChild(document.createTextNode('or select from an existing folder'));
    	formtag.appendChild(document.createElement('br'));
    	formtag.appendChild(uploadselect);
    	formtag.appendChild(document.createElement('br'));
    
    	var uploadinputDiv = document.createElement('div');
    	uploadinputDiv.id = 'uploadinputDiv';
    	uploadinputDiv.className = 'uploadinputDiv';
    
    	var uploadinput = document.createElement('input');
    	uploadinput.type = 'file';
    	uploadinput.disabled = true;
    	uploadinput.name = 'uploadinput';
    	uploadinput.id = 'uploadinput' + self.uploadinputindex;
    	uploadinput.className = 'uploadinput';
    	uploadinput.onchange = self.testfiletype;
    
    	var uploadhidden = document.createElement('input');
    	uploadhidden.type = 'hidden';
    	uploadhidden.name = 'MAX_FILE_SIZE';
    	uploadhidden.id = 'uploadhidden';
    	uploadhidden.className = 'hiddeninput';
    	uploadhidden.value = '3000000';
    
    	formtag.appendChild(document.createTextNode('next'));
    	formtag.appendChild(document.createElement('br'));
    	formtag.appendChild(uploadhidden);		
    	formtag.appendChild(uploadinput);
    	//formtag.appendChild(document.createTextNode(self.uploadinputindex)); 
    
    	var uploadareacancel = document.createElement('input');
    	uploadareacancel.type = 'button';
    	uploadareacancel.id = 'uploadareacancel';
    	uploadareacancel.className = 'uploadareacancel';
    	uploadareacancel.value = 'cancel';		
    	uploadareacancel.onclick = function() {self.uploadinputindex = 0;upfolderinput.value = 'enter a new folder name(up to 30 characters)';self.photopageDiv.appendChild(self.photosareaDiv);self.photopageDiv.removeChild(self.uploadareaDiv);div=self.photobuttonDiv;div.removeChild(self.closeupload);div.appendChild(self.openupload);}
    
    	var uploadbutton = document.createElement('input');
    	uploadbutton.type = 'button';
    	uploadbutton.disabled = true; 
    	uploadbutton.id = 'uploadbutton';
    	uploadbutton.className = 'uploadbutton';
    	uploadbutton.value = 'upload';		
    	uploadbutton.onclick = function() {formtag.target = 'upload_target';formtag.submit();self.uploadinputindex = 0;upfolderinput.value = 'enter a new folder name(up to 30 characters)';self.photopageDiv.appendChild(self.photosareaDiv);self.photopageDiv.removeChild(self.uploadareaDiv);div=self.photobuttonDiv;div.removeChild(self.closeupload);div.appendChild(self.openupload);}
    
    	var uploadareabr = document.createElement('br');
    	uploadareabr.className = 'clearBoth'
    

     

    if there is a better way i would like to know........

     

    thanks mike

  12. is it possible to create a form that will be used to upload files using dom and ajax....

     

    something like this maybe

     

    var formtag = document.createElement('form');
    	formtag.enctype = 'multipart/form-data';
    	//formtag.type = 'multipart/form-data';
    	formtag.id = 'uploadform';
    	formtag.className = 'uploadform';
    	formtag.onsubmit = function() { return false; }
    
    	var upfolderinput = document.createElement('input');
    	upfolderinput.id = 'upfolderinput';
    	//upfolderinput.name = 'upfolderinput';
    	upfolderinput.className = 'upfolderinput';
    	upfolderinput.value = '       create new folder(up to 30 characters)';
    	upfolderinput.onclick = function() {upfolderinput.value = '';uploadselect.disabled = true;uploadinput.disabled = false;}
    
    	var uploadselect = document.createElement('select');
    	uploadselect.multiple = false;
    	uploadselect.name = 'uploadselect';
    	uploadselect.id = 'uploadselect';
    	uploadselect.className = 'uploadselect';
    	uploadselect.onclick = function() {upfolderinput.disabled = true;uploadinput.disabled = false;}		
    	for (var i = 0; i < (folders.length - 1); i++) {
    		var y=document.createElement('option');
    		y.text=folders[i];
    		try
    		  {
    		  uploadselect.add(y,null); // standards compliant
    		  }
    		catch(ex)
    		  {
    		  uploadselect.add(y); // IE only
    		  }
    	}
    
    	var uploadnewfolderDiv = document.createElement('div');
    	uploadnewfolderDiv.id = 'uploadnewfolderDiv';
    	uploadnewfolderDiv.className = 'uploadnewfolderDiv';
    
    	formtag.appendChild(document.createTextNode('first'));
    	formtag.appendChild(document.createElement('br'));		
    	formtag.appendChild(upfolderinput);
    	formtag.appendChild(document.createElement('br')); 
    	formtag.appendChild(document.createTextNode('or select from an existing folder'));
    	formtag.appendChild(document.createElement('br'));
    	formtag.appendChild(uploadselect);
    	formtag.appendChild(document.createElement('br'));
    
    	var uploadinputDiv = document.createElement('div');
    	uploadinputDiv.id = 'uploadinputDiv';
    	uploadinputDiv.className = 'uploadinputDiv';
    
    	var uploadinput = document.createElement('input');
    	uploadinput.type = 'file';
    	uploadinput.disabled = true;
    	uploadinput.name = 'uploadinput';
    	uploadinput.id = 'uploadinput' + self.uploadinputindex;
    	uploadinput.className = 'uploadinput';
    	uploadinput.onchange = self.testfiletype;
    
    	var uploadhidden = document.createElement('input');
    	uploadhidden.type = 'hidden';
    	uploadhidden.name = 'MAX_FILE_SIZE';
    	uploadhidden.id = 'uploadhidden';
    	uploadhidden.className = 'hiddeninput';
    	uploadhidden.value = '3000000';
    
    	formtag.appendChild(document.createTextNode('next'));
    	formtag.appendChild(document.createElement('br'));
    	formtag.appendChild(uploadhidden);		
    	formtag.appendChild(uploadinput);
    	//formtag.appendChild(document.createTextNode(self.uploadinputindex)); 
    
    	var uploadareacancel = document.createElement('input');
    	uploadareacancel.type = 'button';
    	uploadareacancel.id = 'uploadareacancel';
    	uploadareacancel.className = 'uploadareacancel';
    	uploadareacancel.value = 'cancel';		
    	uploadareacancel.onclick = function() {self.uploadinputindex = 0;upfolderinput.value = 'enter a new folder name(up to 30 characters)';self.photopageDiv.appendChild(self.photosareaDiv);self.photopageDiv.removeChild(self.uploadareaDiv);div=self.photobuttonDiv;div.removeChild(self.closeupload);div.appendChild(self.openupload);}
    
    	var uploadbutton = document.createElement('input');
    	uploadbutton.type = 'button';
    	uploadbutton.disabled = true; 
    	uploadbutton.id = 'uploadbutton';
    	uploadbutton.className = 'uploadbutton';
    	uploadbutton.value = 'upload';		
    	uploadbutton.onclick = function() {self.uploadinputindex = 0;upfolderinput.value = 'enter a new folder name(up to 30 characters)';self.saveupload();self.photopageDiv.appendChild(self.photosareaDiv);self.photopageDiv.removeChild(self.uploadareaDiv);div=self.photobuttonDiv;div.removeChild(self.closeupload);div.appendChild(self.openupload);}
    
    	var uploadareabr = document.createElement('br');
    	uploadareabr.className = 'clearBoth';
    
    	var uploadareabr2 = document.createElement('br');
    	uploadareabr2.className = 'clearBoth';
    
    	//formtag.appendChild(uploadnewfolderDiv);
    	//formtag.appendChild(uploadinputDiv);
    
    	formtag.appendChild(uploadbutton);
    	formtag.appendChild(uploadareacancel);
    	formtag.appendChild(uploadareabr);
    	formtag.appendChild(document.createElement('br'));
    
    

    .......

     

    the file info doesnt seam to get sent with the rest of the data......

  13. well this worked but did not give the affect that i was looking for.....

    var s = whatever;

    s = s.replace('<','<').replace('>','>').replace('&','&');

     

    so i added another line like this and for some reason it works and kills the html tags in fire fox and ie.

     

    var s = whatever;

    s = s.replace('<','<').replace('>','>').replace('&','&');

    s = s.replace('<','<').replace('>','>').replace('&','&');

  14. on a page that i am working on i use js to create all the elements and then append the information that  is retrieved via php from the database....

     

    how can i defang the html that may get entered by a user.....

    if the information was displayed with via php i would use something like print htmlentities($users value here); and it would make the html that a user may enter not work....

     

    how can i do the same thing in js......

     

    so that if a user enters something like value <br> value it would get displayed

    as :

    value <br> value, and not as,

    value

    value

     

    any help would be great mike......

  15. well i think that would work but i figured out that i didnt need to do that at all.....

     

    just putting div.ondblclick = self.toggle;      fixed the problem for me.......

     

    i was trying to make it to complicated i guess......

    i was under the impression that i would need a value for each on when really i didnt.....

     

    thanks for all that responded....

    mike 

     

    here is the final code that i am using, converted to work with my ajax....

     

    insertfriend = function(name,pic,status,logtime,logdate,newid) {
    	var self = getfriends;
    	var div = self.Div;
    	var entryFirst = null; 
    	var fddiv = document.createElement('div');
    	fddiv.id = 'friend' + newid;
    	fddiv.className = 'friend';		
    	var fnamediv = null;
    	var fpicdiv = null;
    	var fpic = null;  
    	var fonlinediv = null;
    	var flogtime = null;
    	var flogdate = null;
    	fnamediv = document.createElement('div');
    	fnamediv.id = 'fnamediv' + newid; 
    	fpicdiv = document.createElement('div');
    	fpic = document.createElement('img');
    	fpic.src = pic;
    	fpicdiv.id = 'fpic' + newid;
    	fpic.className = 'fpic';
    	fonlinediv = document.createElement('div');
    	fonlinediv.id = 'fonlinediv' + newid;
    	flogtimediv = document.createElement('div');
    	flogtimediv.id = 'flogtimediv' + newid;
    	flogdatediv = document.createElement('div');
    	flogdatediv.id = 'flogdatediv' + newid;
    	fnamediv.appendChild(document.createTextNode(name));
    	fnamediv.appendChild(document.createTextNode(newid));
    	fpicdiv.appendChild(fpic);
    	fddiv.appendChild(fnamediv);
    	fddiv.appendChild(fpicdiv);			
    	fonlinediv.appendChild(document.createTextNode(status));
    	flogtimediv.appendChild(document.createTextNode(logtime));
    	flogdatediv.appendChild(document.createTextNode(logdate));
    	fddiv.appendChild(fonlinediv);
    	if (status == "online") {
    		fonlinediv.className = 'fonline';
    	}
    	else {
    
    		fddiv.appendChild(flogtimediv);
    		fddiv.appendChild(flogdatediv);
    	}		
    
    	div.appendChild(fddiv);
    	div.ondblclick = self.toggle;
    };
    

  16. ok may be i can try to explain better....

     

    different users have different amount of options stored in database....

     

    d has 3 options...

    j has 5....

    h has 10... and so on..

     

    so i use a for loop to create divs and use a counter to increment the divs, like so

    div = document.createElement('div')

    div.id = 'thisdiv' + counter

    giving me    div0, div1, div2 and so on.....

     

    now i need a way to do something like

     

    increment + counter = document.getElementById('thisdiv' + counter)

    increment + counter.ondblclick = do something

     

    for each of the div s, so i would think that a for loop would work,

    the problem is that when i double click  on any of the options i only get the value of the last div.........

    so i need a way to do the above so that the var named increment is incremented inside the for loop.....

     

    hope that this makes more sense....

     

    thanks mike.....

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.