Jump to content

chasethemetal

Members
  • Content Count

    169
  • Joined

  • Last visited

Everything posted by chasethemetal

  1. Also I should add if I add htmlentities() to the echo of the script. My index.php get's all the code. So for some reason or another it's just not loading the jQuery... does it have something to do with the headers?
  2. Hey all! I can't figure out how to echo a script onto a page. This is my situation. I have index.php loading process.php via jQuery $(#div1).load('process.php'); on process.php I have some jQuery like so. echo ' <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script><script>jQuery in here</script>'; if I go to process.php everything is displayed properly. But if I go to index.php nothing get's loaded into the div. Any tips n tricks again would be awesome! thanks.
  3. Solution $(document).ready(function(){$('#form').submit(function() { $.post('process.php', $("#form").serialize(), function(data) {$('#results').html(data);}); return false;});}); Thanks so much for pointing my mind in the right direction.
  4. Ok I'm following you now. Thank you.
  5. I want to use Ajax method's, I am trying to illustrate to myself the most SIMPLE version of this, If I can figure out how to make this simple task happen I'll be able learn more quickly.In english what my example is attempting to do is: You have a form, you type in data, that info is sent to a process page when a specific form is submitted, then the results are displayed in a div. This way the page doesn't have to reload only the specific element. I have found examples online of how to do this, but all of them have a bunch of extra features and functionality. I'm just trying to see what the si
  6. Thanks! But using the submit() method the page will have to reload correct?
  7. Hey all, I am trying to learn how to create a very simple Hello World ajax jquery example using PHP as the processor. And I'm not sure how to achieve this in a very simple manner. I found examples that used a jQuery validate plug in. But I was wondering what the most simple method would be. Also the point of this is to change the content of #results div without reloading the page. My simple code looks like this thus far. jQuery $(document).ready(function(){$.post('process.php', $("#form").serialize(), function(data) {$('#results').html(data);}); }); HTML <form name="form" id="form" act
  8. Thats it! I just began working with implode() before you posted this! So what this is doing is injecting the second part of $count after itself after a "," basically? Anyways this is the method I was looking for, thank you so much!
  9. This works. But it is not dynamic. foreach ($records as $date => $count) { $part1 = "['" . $date . "', "; $part2 = "$count[0], $count[1], "; $part3 = "],"; $countData .= $part1.$part2.$part3; } echo $countData; The problem here is $count[] needs to dynamically increase based on the data. This is why we put... for ($a = 0; $a < count($count); $a++) {echo "$count[$a], "; //this is $part2} But I can't seem to combine all of these elements into one variable $countData to be called outside the loops...
  10. Thanks! That method seems a little too hacky work around. With this method the time the loading GIF being displayed isn't dynamic and dependent on the time in which it takes to load that particular div. Let us take a situation where graphs are being loaded into a div, depending on someones internet connection it could take 3 to 15 seconds to load a graph. I wouldn't want to wait longer, and I wouldn't want the image to disappear pre maturely. In a perfect world, onload could be called on any container element not just <body>.
  11. Hey all! So I have this old solution someone helped me with a while back. Here is the working solution... $results = mysql_query($data) or die(mysql_error()); $records = array(); while($info = mysql_fetch_array($results)) { if (!isset($records[$info['date']])) $records[$info['date']] = array(); $records[$info['date']][] = $info['SUM(count)']; } foreach ($records as $date => $count) { echo "['" . $date . "', "; for ($a = 0; $a < count($count); $a++) echo "$count[$a], "; echo "],"; } } This successfully spits the info I need out in this form
  12. Hey all, I'm trying to create a jQuery script that will display a loading gif in a div until the contents of that div are loaded. I've successfully done this using the body onload function, but I need this to work on div's through out a page. I can't come up with a good solution. these are my thoughts, and I know there isn't a .onload() and I know this doesn't work but this should illustrate what I'm trying to accomplish. $('#loading').show();$('#content').onload(function(){$("#loading").hide();}); Any help would be appreciated!!!
  13. Bummer. That's what I was afraid of. Looks like I'll have to use $_POST instead of $_GET.
  14. I am looking for a way to make a URL http://www.site.com/dash/?id=1A2B3C'>http://www.site.com/dash/?id=1A2B3C turn into http://www.site.com/dash/ but the variables in the url still get passed to my PHP script. Will mod_rewrite remove the variables? or does it just change the url you see? Thanks.
  15. Ok got it. Thanks thescientist... simple solution. $('.pages').mouseover(function() {$(this).css({"background-color": "#333"});$(this).children(".txt").css({"color": "#FFF"});$(this).children(".edit").css({"visibility": "visible"});}); $('.pages').mouseout(function() {$(this).css({"background-color": "#EEF0F3"});$(this).children(".txt").css({"color": "#000"});$(this).children(".edit").css({"visibility": "hidden"});});
  16. Ok I will look into this, thank you. I wonder though... The thing is there will be a dynamic range of these groups of threes... meaning... <div class="pages"><div class="txt"></div><div class="edit"></div></div> will repeat, a dynamic amount of times like <div class="pages"><div class="txt"></div><div class="edit"></div></div><div class="pages"><div class="txt"></div><div class="edit"></div></div><div class="pages"><div class="txt"></div><div class="edit"></div
  17. Well changing the class isn't the issue here, I'm successfully changing/altering the classes and removing them. If you look at my html structure you see if have 3 classes. pages, txt and edit. Now when I mouse over .pages, I want it to change only that instance of .pages that instance of .txt and that instance of .edit. Right now it works with changing that instance of .pages because in the mouseover function it targets $(this), but I basically need it to target this.txt and this.edit when the mouse goes over .pages too. Does that make sense? Any other ideas would be appreciated.
  18. Hey all, I'm trying to change some CSS class attributes on specific instances. Let me show you what I mean. So the code here changes the background color correctly of the container only on the div we are hovering. But I need it to change the txt and edit properties of that instance only too.... Can't figure it out... Any help would be appreciated! thanks. $(document).ready(function(){ $('.pages').mouseover(function() {$(this).css({"background-color": "#333"});$('.txt').css({"color": "#FFF"});$('.edit').css({"visibility": "visible"});}); $('.pages').mouseout(function() {$(this).css({"backgrou
  19. I got it to work... but not all the way... Basically the path needed to be ('folder/folder/page.php') I took out the whole http://www.mysite.com/.... But now I noticed the JavaScript in the page.php is not being executed.... It loads all html and css, but no client side scripts... I am trying to include pages on a page using jquery instead of targeting iframes.
  20. No thats the thing. It is on the same domain... The page exists on mysite.com/main.php And the page it's trying to get is at mysite.com/folder/folder/page.php. And I've got other pages that use this method... I'm just not sure why it isn't working?
  21. Hey all. I'm trying to the load the contents of a page into another page via this method. $(document).ready(function(){$("#page").load('http://www.site.com/site.php');}); <div id="page"></div> And I've noticed I'm getting no Response Headers. Also Safari says "cancelled opening page" in the bottom. Any thoughts... Nothing load,and the page is on the same site.
  22. Oh ok. So Sublime Text is your editor of choice? I'm using BBEdit right now. And I don't alike because of this one factor.
  23. Yeah my bad!!! No it is like. $a = "['day', 5],"; sorryyy. But still when doing that it makes all of the color coding of the code all messy. Any thoughts on clearing that up?
  24. Hey all. I was wondering how one would escape brackets of this nature [ ]. I'm not sure if escaping is what I need to do either. Basically I have PHP echoing javascript. But whenever [ ] are involved it messes up all of the code coloring of BBedit / Dreamweaver etc.... This is isn't too serious, and the code still works. It just makes all of the color coding messed up. Right now I'm looping something that looks like this.... $a .= ['day', 5], this is something thats been bothering me for awhile. it's like a needle in my side. Thanks
  25. I'm pretty sure the parseInt() was truncating the number. But it didn't work because it would basically fire off a 1 for every internal increment the code made until it hid 2 or greater and so on. BUT I found a solution by the way. The media player API comes with an inspector.js file as well, after digging through that I found that it displayed percent played as well but it was written out differently. I'm not sure why this works. But it does. Im not sure what flooring means, is this what the Math.floor below is doing? var percentPlayed = Math.floor(event.player.status.currentPercentAbsolute*
×
×
  • Create New...