Jump to content

unplugged_web

Members
  • Content Count

    897
  • Joined

  • Last visited

Community Reputation

2 Neutral

About unplugged_web

  • Rank
    Invested Member
  1. I changed the code to this: var $buttonID = $j(this).attr('id'); $buttonID = $buttonID.replace("change","data"); console.log($buttonID); and it now worksde to this: var $buttonID = $j(this).attr('id'); and it now works
  2. How do I change the text of this? I'm getting the id of a button (which works) but when I try to change it the console outputs the buttons value instead. This is what I've got: $j(this).attr('id'); var $buttonID = $j(this).val(); $buttonID = $buttonID.replace("change","data"); console.log($buttonID); if I do this though the alert box shows the buttons id: alert($('.change').attr('id'));
  3. The file was automatically saved from a feed so I wasn't able to change the output. I decided to use a cvs copy of the feed instead as that wasn't changed at all
  4. This is what I've got so far but all I get is errors. This is the code I'm using to get the xml file into the database: <?php$xml = simplexml_load_file('feed.xml');foreach($xml->children() as $product) { mysql_query("INSERT INTO data (name,desc,tracking,brand) VALUES ('$product->text->name','$product->text->desc','$product->uri->Track','$product->brand->brandName')");} ?> and this is the XML file: <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE cafProductFeed SYSTEM "http://www.window.com/DTD/affiliate/datafeed.1.4.dtd"><cafProductF
  5. I'm trying to get the contents of a few xml files (all on the server) into a couple of different tables of a database but don't know how to do this. Does anybody have any ideas? All of the files are the same format wise and I need to put the details into two different tables. Thanks in advance
  6. I've got a link that is sent using AJAX but no results are being sent. The link is: <a href="javascript:void(0);" data-flavour="Berry" class="nav_link Berry">Berry</a> While the AJAX is: <script type="text/javascript"> $('.nav_link').on('click', function(){ event.preventDefault(); var flavour = $(this).data('flavour');$.get('/filter/?search=' + $(flavour).val(),{flavour:flavour}).done(function(data){ if(!$('#container').hasClass('is-loaded')) { $('#container').addClass('is-loaded'); $('#container').html(data);} else { $('#container').append(data);} });
  7. I've added this to a site I'm working on but want the card type to be included when the form is submitted but don't know how to update the input value when the card number is entered. At the moment I've got a span class which shows the card image (done using the above example) and then the user has to select their payment method before the form will send. How do I change it so that the type is added to a hidden text field?
  8. Yep coincidence I agree but I can assure you that it's not me, although you're right I used to work for a company in High Road (how did you know that one!!) although I'm no longer in London now
  9. Thanks, I'll give that a go!
  10. Probably a dumb question but how would I do that? Nah that's not me
  11. Sorry I don't understand what you mean?
  12. Essentially what I've got is a page of comments. Only ten of them are loaded. People can click to say if a comment was helpful or not. This works okay but after more comments are loaded (which are being loaded by using the code below) the code to give feedback stops working. All of the comments are being loaded dynamically so I've given the button a class rather than an id. The code to count the feedback in below where all of the comments are but all except the first ten comments are loaded but the user doing something after the page has loaded <script type="text/javascript"&g
  13. I tried to use it like this: <script type="text/javascript">var newElement = $(bits[1]);newElement.click(function() {$(".rate-yes").click(function(e) { // "this" here corresponds to the button that was clicked var self = this; $.ajax({ async: false, type: "POST",url: "rate.php?rate=good&id=" + $(self).val(), data: $(self).serialize(), // self instead of the class success: function(data) { $('#helpful' + $(self).val()).fadeOut("fast", function() { $(this).before("<div class='rate'>Was this comment helpful? &l
  14. I'm really sorry but I don't understand what I should do? Should I use .live() or newElements?
  15. I have two pieces of code, one loads more comments and the other sends feedback. Both of the calls use AJAX and work separately but they don't work together. The code I've got is: <script type="text/javascript"> var comments_offset=<?php echo $more ?>; function comments_load() { $.ajax({ url: "/comments.php?pid=<?php echo $id ?>&offset="+comments_offset+"&t="+Math.random(), success: function(data){ if( data.substring( 0,5 )!="failed" ) { bits=data.spli
×
×
  • Create New...