Jump to content

RichardRotterdam

Members
  • Posts

    1,509
  • Joined

  • Last visited

Everything posted by RichardRotterdam

  1. what i usually do i just upload the image in a folder and store the image url as a string. but i guess blob type has some advantages.
  2. <script> var isAdmin=<?php echo($isAdmin)?> if(!isAdmin){ display lightbox with login form } </script>
  3. uhm you mean ai right? i think ppl have been trying to create ai since the 60's and still havent succeeded that even comes close to a real human. but creating a simple ai would still be a very challenging task
  4. can you clarify that? what is it you are trying to do? uploading to photobucket is just a matter of going to photobucket.com
  5. maybe you could use a global //declare global outside function var global_div_id function get_and_replace(url,div_id) { global_div_id=div_id //Replaces the innerHTML of the div with the response from the the URL createXMLHttpRequest(); xmlHttp.open("GET",url); xmlHttp.onreadystatechange=callback; xmlHttp.send(null); } function callback() { if(xmlHttp.readyState==4) { if(xmlHttp.status==200) { //HERE IS WHERE IS USE THE VARIABLE div_id div_element=document.getElementById(global_div_id); div_element.innerHTML=xmlHttp.responseText; } } }
  6. just typecast it $yourNumber=999; $numberInString=(string)$yourNumber;
  7. why not do this instead? <script> <?php echo("your javascript"); ?> </script> or <script> <?php include("test.php"); ?> </script>
  8. its either for creating an object or setting the type of a variable
  9. actually in javascript you dont have to do that you only say holdAnswer is of a type boolean you can do the same with arrays myArray=new Array(); but for a boolean isnt really needed
  10. that is the correct way to add a background color to a table maybe the stylesheet isnt linked correctly try changing the color see if it makes a difference or use a style tag inside the same page
  11. javascript is clientside(unless is asp which can run server side) which means it runs in your browser php runs on the server. this means you cant insert javascript into php. you can create a workaround. describe your you can use php to generate javascript which might be the thing you are looking for. problem and maybe you might not need javascript at all or php.
  12. just to add a little something. you dont need the file extension you can get the file type instead //if this is an image it will have the value "image/gif" "image/jpeg" or "image/png" $_FILES['imgfield']['type'];
  13. I use frameworks only these days for my ajax funtionality prototype and and mootools do a great job with this. It makes you able to write a few simple lines instead of using the usually long script. for example instead of using this which is a pain to modify for starters and i know i have been there var xmlHttp function showCustomer(str) { xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) { alert ("Your browser does not support AJAX!"); return; } var url="getcustomer.asp"; url=url+"?q="+str; url=url+"&sid="+Math.random(); xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function stateChanged() { if (xmlHttp.readyState==4) { document.getElementById("txtHint").innerHTML=xmlHttp.responseText; } } function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } you can use this //when the button start is clicked the ajax function will start $('start').addEvent('click', function(e) { e = new Event(e).stop(); //the external page that will be loaded var url = "http://demos.mootools.net/demos/Ajax/lipsum.html"; /** * The simple way for an Ajax request, use onRequest/onComplete/onFailure * to do add your own Ajax depended code. */ new Ajax(url, { method: 'get', update: $('log')//the element log that will be updated <div id="log"></div> }).request(); });
  14. i recommend you post your html output and css so someone can give you a helping hand. What I usually do is search for css menu's builded with li tags and just put in my own data and modify my css
  15. what you are trying to build is called a RTE(rich text editor) you dont need ajax at all its all javascripting. You will need to build something that will dynamically change your textarea into a text area that with buttons. Try looking up javascript DOM for this functionality. for the buttons you will need to create events. Building your rich text editor is going to be a lot of work so good luck with it. If you get stuck with building something like that try looking up tinyMCE or FCKeditor at least you will have an example for what you are building. Hope that helps
  16. uhm thats kinda vague be more specific. do you want an alert? <a href="javascript:alert('your text sir')" >text </a>
  17. that is very well possible you need some sort of ajax form
  18. it could be because you saved in as3 format the getUrl function doesnt work in as3
  19. I dont get this at all. why not just use php include and div instead if you really want scrolling content just add a css scrollbar
  20. is it ok to use use a javascript framework? I could fix it with no trouble at all using mootools or prototype
  21. I think you could solve it like this I'm not gonna write the script for you since that wouldnt be any fun . 1. split the input into an array so that each character has its own array for example $string="0XY"; //now you need each character in its own array $splittedString[0]="0"; $splittedString[1]="X"; $splittedString[2]="Y"; now you need to convert each character to a number for the first character the range would be 0 to 36 the rest you will have to figure out but basicly what you want is a function that converts your character set to a number and a number to the character set good luck
  22. Why do you need javascript or are these the actions that have to be done when the page has already loaded? in that case it would be a ajax problem
  23. uhm not exactly sure what you mean but would that just mean set an attribute in the style using javascript? style="display:hidden"
  24. Just use the SetTimeOut function http://www.w3schools.com/js/js_timing.asp
  25. hmmm usually only the basics are described very well in these books. The thing is most of the advance javascripting isnt really nicely described in books. The best javascripting is usually accomplished using javascript frameworks such as prototype, mootools and jquery. These frameworks continuously grow and books pretty much reach their expire date very fast on this topic. But if you are determined to get a book try getting one that uses one or more of these javascript frameworks
×
×
  • 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.