Jump to content

melting_dog

Members
  • Posts

    118
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.tech-knowledge.com.au

Profile Information

  • Gender
    Male
  • Location
    Brisbane, Australia

melting_dog's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. But...why? Why not make a PHP page that spits out a json-formatted document from the database every time you call it? Why all these extra steps? Thanks for the response! And to answer your question of why: because I am trying to learn the best way of approaching this. Are you suggesting using the having my JavaScript read directly from the .php file using JSONencode?
  2. Hi all, I am trying to figure out a way to make a JSON script more dynamic and responsive to a database. I am forming and idea in my head and just wanted to run it past people here - not expecting any coding answers just want to know if it is possible. Use PHP to query the DB and create some vars, Write the vars to a txt file adding in the necessary JSON brackets, Use PHP's JSON Encode to encode the txt file to JSON Repeat when ever the database is updated What do you guys think? Is this a plausible scenario?
  3. Hi all. I have a simple mail script that doesnt appear to be working. I get a: Parse error: syntax error, unexpected T_STRING error: My code is: mail("$webmaster_email", "RSVP from WC Entry Form", "From: $email \n Name: $firstname $lastname \n Phone Number: $phone \n Address: $postal \n Other Artist: $otherband \n Recieve more news: $newsagree" ); But i cant seem to see whats wrong with it. Can anyone point me in the right direction? Thanks
  4. Hi all, I am using a ModX CMS and want to have my own php file (my.php) in the root directory that connects to the database independently of the CMS. However, I am unsure of how to connect to the database securely ie: so that no-one sees my username and password etc. The CMS has its own config file with all the DB connection info already in variables that is locked away in a folder with permissions set so that browsers cannot access it but I am unsure how to pass those varaibles to my.php (this occurs in the index.php file in the root but I have been unable to replicate it). Can anyone suggest a way for me to do this? Thanks!
  5. Yeah I've had that too on other machines - Ive made sure Skype is off on this one. There is a WinNT program using port 80 but as I have changed Apaches port it should be fine, but...
  6. Hi all, I am having troulbe with an XAMPP install (on a Windows 7 machine). The install went fine but Apache simply wont start. I get the error: ERROR: Apache service not started [-1] I have changed the port to a free one but the same issue occurs. Can anyone help me out? Thanks!
  7. Cool got it. Havent really solved the problem but I now know I must use PHP to encode the JSON on the server side. Then I can use JQuery to read the PHP from the server.
  8. Thanks for the reply. Basically, I am trying to transfer some data from one site to another, like how the Twitter API does. My goal is to have other sites updated from one, central site. Would I have to use PHP to achieve this?
  9. Just wondering does anyone know how to use JQuery or JavaScript to store JavaScript Vars in a JSON file? Thanks!
  10. Thanka Mijii I had declared the var up in my header but for some reason it only works this way.
  11. Hi all, A simple one but it seems I am running into trouble. All I want is to add a JavaScript variable to the html body as part of an <a> tag, eg: <a href="JAVASCRIPT VARIABLE">Click Me</a> Here what I have: <div class="headerrefresh"><script>document.write('<a href="'+pathname+'">Refresh</a>')</script></div> Any help woud be very appreciated! Thanks!
  12. OK got it working using: $(document).ready(function() { $('#tab-bar a').on('click', function(e){ e.preventDefault(); $('#pages .current').removeClass('current'); $(this.hash).addClass('current'); }); }); Main issue was there was no space between #pages and .current Cheers
  13. Sorry - So the code is meant to show the div related to the a tag thats been clicked in <footer>. If I click <a href="#camera">Camera</a> I want <div id="camera">Camera</div> to show - ie: become <div id="camera" class="current">Camera</div> as .current has the display:block; css, whist all other divs within #pages have display:none; css. Right now when I run the script simply nothing happens. I am hoping that someone with a fresh set of eyes and a little more experience can help me out. Thanks!
  14. Hi all, I know this is a bit amiguous but I am hoping someone can suggest something. I have what should be a simple piece of code - just hides and shows divs when a link is clicked. JQuery is: <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#tab-bar a').on('click', function(e){ e.preventDefault(); var nextPage = $(e.target.hash); $('#pages.current').removeClass('current'); }); }); </script> CSS: #pages > div { display: none; } #pages > div.current { display: block; } HTML: <div id="wrapper"> <div id="main-content"> <!--<div id="accelerometer">Waiting for accelerometer...</div>--> <div id="pages"> <div id="map" class="current"> Map </div> <div id="camera"> Camera </div> <div id="twitter"> Twitter </div> </div> </div><!--MAIN-CONTENT--> </div><!--WRAPPER--> <footer> <ul id="tab-bar"> <li> <a href="#map">Map</a> </li> <li> <a href="#camera">Camera</a> </li> <li> <a href="#twitter">Twitter</a> </li> </ul> </footer> I have tested to see if jquery is loaded and its ok. I have tested to see if the click is working using console.log and thats ok - I just dont know what could be wrong! Any help would be greatly appreciated! Thanks!
  15. Hi all, I have been experimenting with a JQuery Twitter Plugin. In it, is has this line: //place the tweet within a paragraph tag within the main div. holder.append("<p>"+item.text.makeLinks()+"</p>"); Now, that makes sense: It simply puts the Tweet in paragraph tags and appends it to the holder. But I am unsure of what makeLinks() does. In fact it causes an error: Uncaught TypeError: Object Tweet text blah blah blah http://t.co/W6GNA4ps has no method 'makeLinks' If I remove the makeLinks() it runs fine but any links in the tweet to it do not work. Heres the full code: (function($){ //Creating Function called Twitterize $.fn.twitterize = function(username,options){ //check to see if the username has been set. if (username){ //create an object full of default settings. var defaultSettings = { count:'1' } // Finds which default settings have been overwritten by the options object // and creates a new object with all the new and untouched settings. var settings = $.extend(defaultSettings, options); // The URL for the Twitter JSON API. var url = "http://twitter.com/status/user_timeline/"+username+".json?count="+settings.count+"&callback=?"; //Variable to get around scope problem in callback function. var holder = this; //Contact Twitter $.getJSON(url, //This function is called when twitter responds with the appropriate information. function(data){ //Step through each tweet. $.each(data, function(i, item) { //place the tweet within a paragraph tag within the main div. holder.append("<p>"+item.text.makeLinks()+"</p>"); }); }); } else{ //Username paramater has not been set. console.debug("jquery plugin twitterize requires a username! Check your parameters"); } //Return itself return this; };//END TWITTERIZE })(jQuery); Any help would be appreciate!
×
×
  • 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.