RichardRotterdam
Members-
Posts
1,509 -
Joined
-
Last visited
Everything posted by RichardRotterdam
-
the documentation with these frameworks are usually excellent so here you go http://www.prototypejs.org/learn/introduction-to-ajax
-
prompting user for confirmation when deleting contacts
RichardRotterdam replied to helloanddie's topic in Javascript Help
all you need to do is use the javascript confirm function here is an example <a href="http://www.phpfreaks.com" onclick ="return confirm('do you want to go to phpfreaks?')">php freaks</a> -
other then that using frameworks makes your javascript code a lot cleaner and programming OO looks more like you would in php. Strange i havent used any php framework yet I'm still debating about using either Zend or cakePHP . but thats offtopic from this. back to your topic what would you concider advanced javascript?
-
best way to learn it is by just trying out some javascript tutorials which involve javascript DOM and Ajax. avoiding the frameworks for learning purposes would be a good idea but once you get the hang of it useing a framework would be a good idea to safe your self a lot of time and frusteration. for example typing $('content_div') //instead of document.getElementById('content_div'); //or even better //ajax action $('ajax_content').load('ajax_call.php'); really makes things a lot easier
-
[SOLVED] language comparison reference
RichardRotterdam replied to scottybwoy's topic in Javascript Help
actually javascript and php are very similar in syntax so having having a manual on the different functions wouldnt be that much of value. there are some slight differences. i think the isset($var) you can simply replace with if(jsVar!=undefined){} //or if(jsVar!=null){} -
like someone has in his/her signature (dunno who) the quality of a response depends on the quality of the question. What is it you dont understand aks your self these questions and then ask them on the forum
-
like corbin said Java != JavaScript. which means Java is a complete different thing then javascript i suggest you start with opening one popup <script> function popup(){ //open a popup } </script> <button onclick="popup()">open popup</button> the function does nothing yet thats up to you
-
something like this maybe? <script> function presentData(value){ document.getElementById('div_for_update').innerHTML=value; } </script> <select onchange ="presentData(this.value)"> <option value="value 1 passed">1</option> <option value="value 2 passed">2</option> <option value="value 3 passed">3</option> </select> <div id="div_for_update"> </div> oh and the select element wasnt closed that might cause trouble in ie
-
It depends on if i use an IDE and what language. normally in php i just use dreamweaver and using the enter for every curley bracket becomes annoying so i use nr 1. how ever if i use eclipse or flash develope for developing flash c++ or java it automaticly creates the nr 2 notation so i let it be for what it is
-
well shortly its not but there is a way to pass a variable from php to javascript. 1. php is serverside which means it(usually) runs on remote computer with apache or IIS. the server handles the php and throws out html only. And the users viewing a page never gets to see a bit of php. which is a good thing think of how easily it would be to hack into a system if you could see the php source in a browser. 2. javascript is (in most casses) clientside which means it runs in the browser ie firefox etc. in other words it runs on the computer of the person viewing a webpage. but anyway back to passing variables from php to javascript. what you basicly want is letting php write javascript on your server <script> var myJavascriptVar='<?php echo("my php string");?>'; //alert the value alert(myJavascriptVar); </script> in your browser select view source now it will look like <script> var myJavascriptVar='my php string'; //alert the value alert(myJavascriptVar); </script> and this is exactly what is being done in your browser
-
what exactly are you trying to do? and since this is just javascript your server doesnt have any effect on it what so ever only your browser could change the effect
-
Run a PHP Script at the end of a timer?
RichardRotterdam replied to ronnie88's topic in Javascript Help
well if it is that you want to do the update without the page reloading you should read up on some ajax tutorials. try out some stuff and see what it does. the easiest way is to use javascript frameworks such as jquery prototype or dojo etc. but the basics described here where I originally learned it from 2 years ago would work. http://www.w3schools.com/Ajax/Default.Asp -
i used fckeditor a couple of times. I think its a matter of just walking throught the steps described on the site the language packs are included its more about what you dont need rather then what you need since it comes with everything
-
Run a PHP Script at the end of a timer?
RichardRotterdam replied to ronnie88's topic in Javascript Help
is it that the page cant be reloaded or can be reloaded. if you can reload it just do a javascript redirect. if you can't use ajax -
[SOLVED] update mysql table not working.
RichardRotterdam replied to cleary1981's topic in Javascript Help
looks like an ajax update to me. I can't check the code right now but i'll give you some tips how to track your problem relatively fast. 1. try to run your php page that does the update to database by placing that url into your browser(you prob already did that) 2. change all your post variables to get and echo them to make sure you got all variables when calling the update php directly 3. use firebug to see your ajax call and track your bugs -
I know it looks like a ER diagram it hasn't been filled with all the methods yet its just a sketch of what i want to build The database actually looks like that only that you cant store an object airport into flights for just an example I've bumped into the term MVC a couple times and I did a little searching on it i am however very knew to it. The MVC is prob also the way most Java programmers do it . Any good links about the MVC approach besides Google. Another aproach would be to just instantiate a list of objects on requested php page but that would most likely be ugly
-
I haven't tried this one out but as so far it seems to be the nicest one i have found and i am planning to use this one. it does however use some flash but this is probably just a minor thing http://digitarald.de/project/fancyupload/2-0/showcase/photoqueue/
-
Ok usually i use a combination of procedural and OO. But i want to build my next project completely in OO to x out a couple of things for school and to make the whole thing more maintainable for future usage Currently I am building a reservation website where you can book hotels, flights and package deals. the package deals are flights combined with a hotel reservation. The diagram looks like this so far If i am to make this thing completely OO where would i put the search hotels method and the search flights. I am probably supose to create new objects for this. anyone has any ideas on this. any comment is welcome thanks in advance
-
[SOLVED] Good javascript WYSIWYG editors
RichardRotterdam replied to emma57573's topic in Javascript Help
a good rich text editor just transforms a textarea into an editor so you can just post the values and insert it into the database. Javascript is all clientside so this has nothing to do with mysql at all. if youre looking for other rich text editors fckeditor and tinymce are nice ones -
you could just replace the single quotes with an ascii character and then do the mysql_real_escape_string() I'm sure that would be safe and it would allow the single quote to be displayed <?php $string=str_replace("'", "'",$string); $string=mysql_real_escape_string($string); ?> PS it should be just the 39 character but this forum messes it up somehow
-
it is possible just little bit tricky without any type of javascript framework. that requires the complete list to be copied and pasted at the end. but in steps this how to do it. 1. clone the tables with data. 2. copy this clone and paste this at the end of the original. 3 check when the clone is scrolled and delete the original. 4 clone the clone and this at the end. but yeah thats pretty advanced javascript.
-
oops i thought thats what you wanted. but here is the reversed verion // global variable for position of the scrolling window var pos=0; function Scroll() { obj=document.getElementById("TablesText"); obj2=document.getElementById("SlotsText"); //this is the scroll speed pos -= 1; //restart when it is at the top instead of refreshing the page //600 is the heigth it will have when restarting from the bottom you might wanna tweak this if (pos<getScrollHeight()) { pos=180; } obj.style.top=pos; obj2.style.top=pos; window.setTimeout("Scroll();",20); } //this function gets the height to scroll function getScrollHeight(){ var tablesTextHeight=document.getElementById("TablesText").offsetHeight*-1; //now lets set those global vars so it will start from the bottom return tablesTextHeight; } // Start scrolling when the page loads window.onload = function(){ //now lets set those global vars so it will start from the bottom pos=180; //lets start scrolling Scroll(); }
-
nah you dont need money to start this. you just need some studieng on ajax javasccripting and php. once you mastered that its really a piece of cake to build you can start by just examining some javascript demo's such as without any javascript framework http://www.walterzorn.com/dragdrop/dragdrop_e.htm using prototype/scriptaculous http://demo.script.aculo.us/shop using mootools http://demos.mootools.net/DragDrop jquery http://interface.eyecon.ro/demos/drag.html
-
try this , I cleaned it up a bit it had too much for something this small // global variable for position of the scrolling window var pos=0; function Scroll() { obj=document.getElementById("TablesText"); obj2=document.getElementById("SlotsText"); //this is the scroll speed pos += 1; //restart when it is at the top instead of refreshing the page //600 is the heigth it will have when restarting from the bottom you might wanna tweak this if (pos>600) { pos = pos=getScrollHeight(); } obj.style.top=pos; obj2.style.top=pos; window.setTimeout("Scroll();",20); } //this function gets the height to scroll function getScrollHeight(){ var tablesTextHeight=document.getElementById("TablesText").offsetHeight*-1; //now lets set those global vars so it will start from the bottom return tablesTextHeight; } // Start scrolling when the page loads window.onload = function(){ //now lets set those global vars so it will start from the bottom pos=getScrollHeight(); //lets start scrolling Scroll(); }