Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'javascript'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 38 results

  1. Per instructions and examples in the book, I am using javascript to initiate use of mysql within a php file to populate the data in a grid within my original javascript file. Everything works fine! However, sometimes, it takes a few seconds for the php file to complete running. I am finding that I need to disable the grid until the php file has completed. I know how to disable the grid using jquery $.blockUI(); and re-enable the grid using $.unblockUI(); using javascript commands in my javascript file. But I cannot figure out how to delay the $.unblockUI(); until the php file has completed. How can I do that? Thank you.
  2. var obj { var name: 'some value', mtd: function () { alert(name); } } obj.mtd(); The mtd function defined in obj has no defined parameters, but when called the this reference and argument list are passed to the function. Is the name property of obj also present in the mtd function so it can be used in the alert() call as above, or does the mtd function have nothing to do with the property named name? if lerry ullman answer my question than it would be so great
  3. I've been trying to get this for a while (includes jQuery) and somehow nothing seems to work. The image gallery works fine but won't display title. $(document).ready(function() { var pics=[]; for (var x=0; x<preLoadPics.lenght;x++) { pics[x]=new Image(); pics[x].src=preLoadPics[x]; } var newPix=new Image(); newPix.src=preLoadPics[0]; $('#thumbPix a').click(function(evt){ evt.preventDefault(); var pixFile=$(this).attr('src'); var pixLink=$(this).attr('href'); var pixTitle=$(this).attr('title'); var oldPix=$('#pix img'); var newPix=$('<img src="'+pixLink+'">'); if(pixLink==oldPix.attr('src')){ return; }else{ $('.selected').removeClass('selected'); //add highlight to this thumbnail $(this).addClass('selected'); //make new image invisible newPix.show(); //add to the #pix div $('#pix').prepend(newPix); newPix.show(); //fade out old image and remove from DOM oldPix.fadeOut(0,function(){ $(this).remove(); }); //fade in new image newPix.fadeIn(0); oldPix.remove(pixFile,'^Lg+\w\.'); } }); //end click $('#thumbPix a:eq(0)').click(); }); //end ready </script> this is body section <div id="thumbPix"> <li><a href="LgPicture.jpg" id="pix"title="Picture"> <img src= "smallPicture.jpg" border="2" bordercolor="#cccc99"/>Picture<br /></a></li> One option that doesn't break it completely is adding pixTitle to the .prepend in the Javascript code. I got it to display title, but then it just builds the titles instead of replacing it. $('#pix').prepend(newPix,pixTitle); newPix.show(); any ideas? Thanks
  4. Hello, I am trying to implement this code into a php script. By itself on a separate page it works fine but wihint a php page I keep getting syntax errors. Thanks, Marie <textarea name="description" id="description" rows="5" cols="40" value="sdf" onkeyup="getCharCount(50)" /> </textarea> <div id="charCount"></div> <script type="text/javascript"> function getCharCount(limit) { var tArea = document.getElementById("description"), countDisplay = document.getElementById("charCount"); countRemains = limit - tArea.value.length countDisplay.innerHTML = "Total characters : " + tArea.value.length + " Remaining: " + countRemains; if (countRemains < 1) alert('Thats all folks'); } </script>
  5. how to include js file in controller ie. some thing like this public function actionIndex() { //load js file here $this->render('index'); } requirement is to load js file in a new page
  6. Hey, everyone. Currently working on a project that requires a lot of Javascript. This includes Ajax requests, some event listeners, Google maps integration, a Wysiwyg-editor and probable some more. I'm currently working with JQuery as I'm not much of a Javascript developer. I will group the code by usage, show an example and tell you if I experience weird behavior. 1. Drop-down search functionality (SOLVED) 2. Multiple file uploads as attachments Intro: The system is based around offers. These offers should allow attachments and possibly a main image. (Think like Wordpress' main article image) Problems/questions/etc: 1) I want the uploading to be done with Ajax. I found a good script that handles this. The problem is that the attachments must be tied to the ID of an offer. This ID, however, does not exists before an offer is published or saved as a draft. How can I tie these two together? 2) As users must be logged in, I create a folder for the user if one does not already exists. This folder is named by the User-ID. This is done because I remember reading about a problem occuring when too many files are lookated in the same folder. Is this neccasary or good, or would you recommend something else? Table structures and data flow: (Only the key structure) Offers ( offer_id, status, user_id* ..... ) Offers_attachments ( offer_id, path, extention.... ) Users ( user_id, ...info... ) Upload script used: (Not that it really matters) valums file-uploader Help me pick a solution: 1.) A two-step process. The users fill out vital information first, click next, (and the article is saved) then add attachments and save with a status. 2.) An empty offer is inserted to the DB when a user clicks "Add new offer". We now have an offer ID to tie attachments to. A daily cron job deletes offers/attachments that were never "Saved" by clicking "Save the offer" by the user. 3.) Attachments are tied to the user instead. The users can then add uploaded attachments found in the database related to their user.
  7. I'm learning from various sources and can usually puzzle out what's going on, but this has me a bit stumped. I came across this code at http://www.webdeveloper.com/forum/showthread.php?224180-JQuery-how-does-it-s-insides-work: function X(css){ //dom utility //a couple of node harvesters, using id and tag name... function el(id){ return document.getElementById(id);} function tags(elm){return document.getElementsByTagName(elm);} //collect output: var out=[]; if(css[0]=="#"){//id out.push(el(css.slice(1))); }else{//tags out=out.concat([].slice.call(tags(css))); };//end if id or tagName //define some methods for the utility: var meths={ hide:function(a){a.style.display="none";}, show:function(a){a.style.display="";}, remove:function(a){a.parentNode.removeChild(a);}, color:function(a){a.style.color=this||a.style.color;}, size:function(a){a.style.fontSize=this||a.style.fontSize;} };//end meths //bind the methods to the collection array: for(var meth in meths)(function(n,m){ out[n]=function(x){out.map(m,x); return out;} }(meth, meths[meth]));//next method return out; }//end X dom utility For the life of me, I am having a hard time figuring out how the Javascript is running in the for loop binding the methods to the collection array. I realize this is advanced, but if someone could walk through what is happening, and how the methods are being called with variables correctly linked to their respective methods, it would be appreciated. This is cool, if only I could understand how it is occurring.
  8. Just wanted to recommend a website called CodeCademy.com. They offer free courses in Javascript, html, css, Ruby and several other languages and courses. It works kind of like a lot of those new apps you find on your phone. You get a task, you provide an answer, that answer is validated, and you can move along to a new course once finished. People learn differently, but I diffidently need to write code alongside learning. For those new to JS, I would definitly recommend reading Larry's book along with these tasks. You'll find out you learn a lot fast and in a fun way. Some of the tasks involve several revision of a black jack game, a cash register and other fun tasks. You also get trophies from a point system considering how well you've done. A very enjoyable and good way to deploy JavaScript code. Has anyone else tried it?
  9. I need to create a modal dialog plugin that enables visitors to opt in to allow cookies. If the user opts out then he can't access the part of the site that uses cookies. If the user opts in, on subsequent visits the opt in box is not displayed. If cookies are not used then the opt in box is not displayed. I think(?) I can do most of this but do not know how to detect if a site uses cookies. I was thinking that I may have to create a front end to allow the website owner to define what cookies the site uses. but is it possible to dynamically detect if a site uses cookies and how would you do so? Also if you have any suggestions re creating this plugin, please post them. Thanks.
  10. Hi, I have a couple of questions regarding PHP and JavaScript. 1) What I would like to know is once I do a SELECT COUNT Query I want to then do a For-Loop to out put the same number of input boxes but with a PHP variable as the value so that JavaScript could pick that value up, Is that possible to be done, I mean can JavaScript/JQuery read PHP variables. They will be Hidden Input boxes as well. PHP 6 MySQL 5.2 HTML5 CSS3 Chrome / IE 8
  11. I need to make an advertising software development kit for users to integrate into their own website. I have a generous PHP & MySQL knowledge, but not so much for Javascript. I would like it to: (a) Connect to the Database ( Select an Ad at random © Not reveal anything about a PHP script (d) Return as a frame an example of what I need is like Google's AdSense program. If you look at an ad, it is in a frame. I need something like this.
  12. Hi. I was just wondering how facebook does it's continious updates on the wall if you know what I mean, I take it after a certain amount of time it calls a scripts which then gets the latest round of updates. So what technologies would be used here ? and also how would you stop it from repeating it's-self(i.e. calling the same data from before) ? Also does anyone know of any examples of this ? Regards
×
×
  • Create New...