Jump to content

piearcy

Members
  • Posts

    24
  • Joined

  • Last visited

piearcy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Absolutely understand. I'm getting 4 errors after removing 1.11.2. All saying different things are not a function. Of of which is $elem. I've read the use of $ is no good with Magento and also read to wrap it as such, $($elem) but his had no effect. Nor does using jquery instead of $. a(document).on is also not a function in bootstrap.js. Then some individual things like owl slider is not found.
  2. Summary, I have a Magento site which was loading about 7 different varieties of jQuery. We want to cut them down to a single library. These ranged from 1.10.1 to 2.1.4. So we have chosen to use 2.1.4 and then fix the errors that come up. This being said, I'm down to a few but now am getting the errors that need correcting. I'm not at ALL a jQuery expert but choose to write in native javascript whenever possible as I'm not a fan of libraries if it can be done natively saving kb's. But this does not help me now as I'm having the afore mentioned errors and not being a jQuery expert I'm not certain what I need to do next. www.dev.michaeltoddusa.com. This is the shortest way for you to look at the source code and let me know where I need to start. Any help is appreciated.
  3. I was thinking this is what is going on. A plugin is calling for the library before it's actually loaded. Thanks. Love the signature. :-)
  4. I should add the other errors are 'undefined is not a function' and 'n is not a function'.
  5. I took on the daunting task of reducing the size of a Magento site. Beast that. At any rate, I have 3 different jQuery libraries loading. 1.10.1, 1.11.1, and 2.1.3. Then 2 different migrates which I would think would fix migration issues if I removed the two older versions. But just removing 1.11.1 gives me the error of 'jQuery is not a function, jQuery is not defined.' many times. Understanding no conflict is being used which should kill $ but not jQuery? What is the easiest way for me to migrate to using solely 2.1.3 and killing off the other two libraries? Perhaps a change log to see what has been removed since 1.10.1 and 1.11.1? I'd appreciate any advice on this one as I'm a php developer and write in jQuery but it is not my forte. Thanks
  6. Thanks guys. Both worked of course but the later was shorter than the former. I knew it would be easy. Appreciate it as always.
  7. I need multiple json files written by their ID number. I call the id separately and also include it in the json file I'm writing. But when I'm writing I'm writing ALL the records in each .json file and not the individual records. I know I'm just overlooking something but anyone? Here's the code. while ($row = $result->fetch_assoc()) { $myArray[] = $row; $message = json_encode(array($myArray)); $id = $row['id']; $myfile = fopen("message/$id.json", "w") or die("Unable to create file!"); fwrite($myfile, $message); fclose($myfile); } Thanks
  8. Just looking over it quickly I'm assuming the function PageMain is being called elsewhere and this is what is breaking your page.
  9. id is the primary key and description is a unique key. I had already looked at those. You have a point and I agree that's what's happening. Now I have to look at this further to figure out why he made description unique. Thanks!
  10. Not sure why this isn't working so thought I would see if others laying eyes on it will see the problem. mysqli_query($mysqliConn, 'INSERT INTO '.$table.' (id, description, car_initials, car_no, site_id, product_id, status_code, available_dt) VALUES ('.$id.', '.$description.', '.$carInitials.', '.$carNo.', '.$siteId.', '.$productId.', '.$statusCode.', '.$availableDt.') ON DUPLICATE KEY UPDATE description = '.$description.', car_initials = '.$carInitials.', car_no = '.$carNo.', site_id = '.$siteId.', product_id = '.$productId.', status_code = '.$statusCode.', available_dt = '.$availableDt.' ') or apiError( array( 'index' => $i, 'id' => $id ) ); Description is a combination of the car initials and car number and is placed in a unique key in the MySql database. But I'm getting this: Duplicate entry 'MWCX300310' for key 'description'. I should not be getting this since I'm doing the on duplicate key update. Am I missing something here? And yes I know this is not a prepared statement. I took this project over from another developer and am in the process of changing everything over to PDO to rectify that problem. Thanks, Dave
  11. Yeah. Tried that. Gave up and decided to write longer code but it works. Just made a series of if else statements to determine with selection was selected and then do it's thing. I have no patience. Going to be slower but it is what it is I suppose. The problem with the above is it doesn't select the correct item. Always chooses the last one.
  12. Quick question that I have not been able to find on the internet. Go figure. Can you apply the jQuery :eq(index) to a selection menu? I use it for list items but have been unsuccessful at using it for a selection menu. Probably because they aren't an ordered list? So I've probably answered my own question there. What could I use in it's place for a selection menu? I'm indexing the actual line item referenced to know what to load thusly... $('.tab-content div.tab:eq(' + $('#tab-menu > li').index(this) + ')').slideDown('slow'); Really need to do the same thing with a selection menu but google has not helped me out so far.
  13. Not really because that's not what I'm doing. Odd that Adam has stuff over on that domain though. What Adam is talking about there is swapping content out using jQuery and PHP using Ajax. I'm not swapping out per se. I'm tabbing through data. And with a selection menu I don't need an on click event. I need an on change event for that selection menu to work. I can make it tab through content using the on click event and targeting the <li>. What I'm having trouble with is the on change event targeting the #tab-menu selection. As stated, I printed to console the value I'm getting back with my code and it's correct. The old tab does indeed slide up. What I'm not getting is the new tab sliding up as it should. Thanks though.
  14. I added a console.log just to see what value I'm getting returned. console.log(txt); $('.tab-content div.tab').slideUp('slow'); $('.tab-content div.tab:eq(' + $(txt).index(this) + ')').slideDown('slow'); And sure enough, I'm getting the text of the line item. So my problem has to be with the last line. $('.tab-content div.tab:eq(' + $(txt).index(this) + ')').slideDown('slow'); I've tried changing (txt) to (this) and (this) to (txt) and different variations and still can't get it to do what I want it to do.
  15. Perhaps I had too much code in the first or maybe not enough. First, here is the HTML. <ul id="tab-menu"> <li>link1</li> <li>link2</li> <li>link3</li> <li>link4</li> </ul> The relevant parts of the jQuery which work for my line items... $('#tab-menu > li').click(function(){ $('.tab-content div.tab').slideUp('slow'); $('.tab-content div.tab:eq(' + $('#tab-menu > li').index(this) + ')').slideDown('slow'); (I removed the mouse over and active states etc. from the above so yes, I know I'm not closing the above but that's because I removed code beneath the relevant part) I could have added the )}; but I'm assuming you all know it's there.) I'm making this responsive. I have that menu on the left and making it stay at the top of the page regardless of where you scroll. OBVIOUSLY this will not work for a phone so I get rid of the line items and populate a selection menu. The code is in my original post and that functions as it should. Though I did change it from populating with the links to removing links and populating with the > li. But now I need that tab to work using my selection menu. Here is what I've tried. I get no errors in console but it still does not work. I've tried .html, .attr, .text, .val and all of which do nothing other than slide up the previous but it's not sliding down the tab I'm looking for. Here's what I have currently. $("#tab-menu select").change(function() { var txt = jQuery(this).find("option:selected").html(); $('.tab-content div.tab').slideUp('slow'); $('.tab-content div.tab:eq(' + $(txt).index(this) + ')').slideDown('slow'); }); Of course this doesn't work either. I would love you forever if you can help me here. :-) Thanks
×
×
  • 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.