Javascript problems on my site. Can't find the error - javascript

Something just happened to my site, and I can't really get my error logs to show any error. It's working perfectly in Firefox so I can't really find the error with firebug. When I analyze the site in Chrome I can't see any errors either, but the javascripts isn't running correctly at all.
When I try to add products to the shopping nothing really happens in Chrome, but when I press "Check Cart" all the products are there. When I press delete nothing happens either, but if I update the site the products are deleted just as they're supposed to.
BUT when I add some products, and then press "Check Card" I get this error message (can't mark the text so unfortunately it's in image mode):
Image
How can I find the error on this one?
My site is at www nosmoke se and I'm using Open Cart 1.5.4.1 if anyone's wondering.

And the end of the JSON being sent, there is an HTML comment that begins with <!--
Find out where that is coming from and get rid of it.
It looks like there is also a script tag there at the bottom that shouldnt' be there.

Attracta added features can cause issues with AJAX requests on certain sites (such as OpenCart). In the end, you need to request for Attracta to have it disabled but that can take from a few hours to a few days.
To remove the Attracta code immediately you will need to delete the .fastinclude file from the 'web root' (document root) of your website.
To delete this file:
1. Log into your account 'File Manager'
2. Choose the 'Web Root (public_html/www)' option and ensure 'Show Hidden Files (dotfiles)' is ticked if using a GUI.
3. Select the file named '.fastinclude' and Delete
After deleting this file, the app will be removed instantly.

Related

Download PDF files Selenium Python

I need some help. I need to download financial statements that are located in PDF files to my MAC using Python. I've tried this using Selenium but unfortunately haven't been able to make progress.
Following is the URL: financials.psx.com.pk
When I load this URL, the page looks like so:
you see the dropdown on the left above "Company Name...", I need to select a company name there. Once I do that, then I see a window like this:
Every link under reports, when clicked downloads a PDF. I require those PDFs. Appreciate any help. Thanks.
I have tried the following code; it selects the company name and shows me the next page for a second but somehow another refresh happens, which leads me back to the original page:
driver = webdriver.Chrome(executable_path="driver-path")
driver.get("https://financials.psx.com.pk/")
elem = driver.find_element_by_id("country")
drp = Select(elem)
drp.select_by_value("SHEL")
Actually, when I select using select_by_value, I can see the second window. I think the code is not stable. But, I am able to select a symbol from the dropdown and see the second page. Now, I need href's from the second page behind links such as 'Quarterly', 'Annual' etc.

Tagdiv Composer loads to infinity: Wordpress Plugin

I am new to Wordpress.
I am working on a news website with the Newspaper theme and Tagdiv composer plugin
After working for a week I have developed a problem which I explain below.
Whenever I want to edit pages with TagDiv Composer, the large spinner icon shows and starts loading. It stays there like forever until I close the page.
In the console (from Developer Tools), I found 2 errors which are shown in the pictures below. The error are actually from in js_files_for_wrapper.min.js
I identified the actual error for Error 1 one this line of code JSON.stringify([d[0].shortcode.attrs.named]) so I made the following deductions:
The problem started after I saved a custom shortcode named “shortcode“ which I think is an object in the js_files_for_wrapper.min.js as per the error line above.
If what I think about the cause is true, could anyone help me with identifying where the custom shortcode I created was saved, and how to delete it?
Was having a similar issue on a brand new theme setup. tagdiv Composer was loading to infinity. Further, my Header and Footer menus were not showing. Had to click to activate the Header and Footer check boxes on this URL, which fixe things: https://yourdomain.com/wp-admin/admin.php?page=tdb_cloud_templates
I wasn't able to contact the theme support because my account was compromised.
However, after long testing and failing, I finally resolved to resetting the theme options from the theme panel.
That solved it, although I had to set my custom colours and fonts, as well as custom CSS all over again.

javascript load in wordpress template issue

I created a wordpress template for a customer and I used a plugin to allow registered users to customize his profile. The issue appears when I'm trying to change the profile photo, the modal windows that allow that don't charge!
Please see this picture: http://tattoobiter.com/custom.png
I tried to insert manually (in chrome console)
<div id="um_umpload_single"></div>
in </div class="um-modal no-photo"> and it works correctly till refresh the page.
I think something of my template don't let javascript to charge correctly, but I can't understand what...
Please help!
I tried to insert the first div in the second with append jquery but don't work...
Problem solved, It seems wordpress have problems to charge javascript external scripts if don't have the "".

How to upload files to a server: Multiple Files and Custom UI

I'm trying to implement a UI that would let the end user upload multiple file sot a server, on a custom UI - pretty much the same way GMail or Outlook.net is doing it.
Few things to node:
The <input type="file"> is ugly - and not standard (IE shows a button named 'Browse' to the left of the file name. Chrome shows a button named 'Choose' to the right of the file name).
Most suggestions how to do the UI suggests hiding a input file element with opacity=0, but on top of by custom UI. The 'click' event will open the dialog box, and upon return the file name (without the path) will be available as a $('#file').val(). See this question, as well as the sample on jsfiddle.
I'm also aware HTML5 has a multiple="multiple" attribute now, which will let the user select multiple files.
However, I'm looking for a multiple file solution, which will work on IE8 and above (as well as WebKit, Mozila).
Some people suggested Google is using Flash. This is not true. Their multi file upload is working when flash is disabled.
Now, here is my biggest surprise: Using the developer tools (F12) on both IE and Chrome, looking at both GMail and Outlook.NET - both implementations do not have a <input type='file'> element in the tree (as far as I can tell). Moreover, both implementations are working with IE8 (flash disabled).
What is going on? How do they do it?
EDIT: Why do I think they don't use file input element? Open the developer tools (F12), switch to Console, type: document.getElementsByTagName('input'). There are 24 input elements, 19 of which are type=hidden, none is type=file.
EDIT 2:Thank you all responders and commentators. Indeed - the "there is no other way" argument (in comment) below was valid. As it turns out, both Outlook.NET and GMail will have a <input type='file'> element, which they will add dynamically, only when the user clicks the 'Attach a file' button. Then, they will send a 'click' event to the element, which will trigger the select file dialog.
The witness this, use the F12 development tool (either in Chrome, or in IE), and in the interactive console type: document.querySelectorAll('input[type=file]'). Note that in both implementations, the element is a direct child of body (with display=none).
They do not use iframe for the upload (unlike the only answer below), but simple XHR code to upload, which is now, in HTML5 is available.
The best resource on the Web for how to do it is: https://developer.mozilla.org/en-US/docs/Using_files_from_web_applications. I've went through the steps of #Jay below (which are great), but the Mozilla page is simpler, which is my recommendation. Also, take a quick look at the jsfiddle sample on #Niranjan comment.
I recently implemented a multi file upload UI for an old asp.net website, but the concepts should be the same.
I'm not very good at writing (summarizing code) but here goes.
Create a number of IFrames. I had problems trying to write IFrames after the document loaded due to security restrictions, so had the server render as many as I though the user would use at once.
Add an 'upload' button and handler which first adds a load handler to one of the iframes.
var frame = $('iframe:first');
in the frame load handler ---
frame.load(function () { /* all the code below* /});
2.a. Write the input tag for file and what ever other elements you like into the frame like this
frame.contents().find('body').html("html goes here");
2.b. Now add a handler to the file input in your frame and submit that form:
frame.contents().find('#fileUpload').change( /*submit the form */)
2.c. Now invoke the file upload dialog
frame.contents().find('#fileUpload').click();
2.d. Now that line will block until the dialog returns. When it does you have to check the value of the file upload control for null in case they canceled. This is where i marked the iframe as not in use.
2.e. Ether way you'll need to unbind from the load of the iframe and rebind to a different method that will handle the return (upload complete)
frame.unbind('load');
frame.load(function () { /* handle file uploaded */})
2.e.1. This is where I reported success to the user and released the frame so it could be reused.
2.e.2. Finally unbind from load again from the upload complete method
All of that is in your frame load handler
3.Now cause the frame to load
frame.load();
At least thats how I did it. I uploaded all the files to a handler which reported file % and a loop inside the parent page fired off ajax getting and displaying the progress of each file.
The main idea is if you want multi file upload in an 'ajaxy' style but not using flash or Html 5 you'll need to use a collection of iframes and some fancy script.
Hope this helps.

Including javascript function, does not work on android

i'm trying to solve a strange problem. I have realized a personnalized project for 2 weeks ago creating personnalized widget and event on them and as a result i want to deploy it on my android device.
For example, this link : http://jsfiddle.net/fc8hL/ show you a checkBox example :
--> first div is a container which can include many checkboxes
--> second div is a checkbox container
--> three img in the previous div are differents images which appear according to mouse/touch event on the checkbox.
--> the js function "check(e)" allows me to treat these 3 images and the event.
THIS FUNCTION WORKS PERFECTLY on both my local computer and my android device! i have realized some others functions in order to put in the HTML buttons, radio and comboBox.
Some events are attributed to this widgets.
Problem is : the final html file is huge : indeed, there is one function per img and i would like to optimize it creating javascript file. That is easy, i just put
<script "checkBox.js"> ***My existing function that works !***
</script>
And when i open my html file... surprise ! that works on my local computer, but not on my android device... Are you seeing an issue for this problem ?
Ok guys,
i have debugged my program thanks to epascarello link, and i found my problem.
On my remote computer, an error is showing :
"Failed to load resource: the server responded with a status of 403 (Forbidden)"
All my files are on a server and i didn't change reading options on them, that's why i couldn't access to all javascripts functions included in these files. Bad mistake...
Thanks a lot for your help :)

Categories