flowplayer html validation - javascript

Ok, Im trying to rebuild a clients website thats long over due for cleanup on the backend and under the hood. This client uses flowplayer for most of the videos seen on any of there sites, and while attempting to validate my code via w3c validator I notice that the validator is throwing 2 errors both pertaining to flowplayer in this case.
http://validator.w3.org/check?uri=http%3A%2F%2Fv2.newyorkbarshow.com%2Fhome&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3
I am using the latest flowplayer out, and following there example (which I don't know if that validates either). So I am wondering if it doesn't validate out of the box, if anyone happens to know a means of correcting it so it will validate.

You need to add data attribute with value "/static/imgs/static/VidAd4BarShow.swf" in your object tag.
note : I see this happens before flow player executes anything within your source...

Related

Pass Information from Cookie into Drift Custom Attribute

I need a little help.
I am trying to pass data from a Cookie inside of GTM to a custom attribute inside of Drift.
I've tried following this documentation, but can't seem to get it to work:
https://devdocs.drift.com/docs/contact-properties
This is the code that I have tried using inside of Google Tag Manager:
drift.on('ready', function() {
drift.api.setUserAttributes({
gclid: '{{cookie - gclid}}'
})
})
I am not very familiar with coding, so I am sure there is some error on my end. Any help would be appreciated.
It's quite challenging to help without knowing what the errors are, but I'll do my best.
The issue is most likely related to either the Drift integration failing to initialize or an error related to accessing the cookie. The best way to solve your issue would be to isolate where the problem lies.
Focussing on Drift, are you sure that Drift has been initialized correctly?
According to the documentation, a custom Drift attribute will be visible in the Custom attributes tab in your contact settings.
You can test this by running the following code snippet in the browser console for the website in question and then checking the Custom attributes tab to check that the test attribute has been created.
drift.on('ready', function() {drift.api.setUserAttributes({test: 'tester',})})
Note that Drift does not initialize when running a website locally so make sure that you're testing with a site that's deployed to a server.
If the above works then we know that Drift is working as expected and the issue relates to how you're accessing the cookie so you'll want to focus on that.
In either case, if you could share your error, it would be very helpful.

How do I solve the ReferenceError in my API calls from my UI?

I have done a microsoft tutorial called Web API with Javascript
I now have a UI made with Javascript and HTML which looks like this:
How do I use the UI? I keep getting a Reference Error. Is there a specific syntax I am supposed to follow when I add and edit something via APIs?
In the future, please copy and paste error messages into your question. I would normally copy and paste the error message in my answer, but I don't want to type it all out :)
The errors (red) mean that you're trying to use JavaScript that is not defined yet. The warnings (yellow) are the reason why.
The second warning says that it could not load the JavaScript. That explains the errors. The first warning might be the reason why. It's saying that the MIME type is empty, when it should be application/javascript.
But you said in the comments that the site.js file is empty when you try to access it directly. Did you save all the JavaScript in step 4 of that tutorial to site.js?
And what are you using as a web server? IIS Express?

setSrc for IFRAME in Dynamics CRM unified form is not working

I am following below walkthrough by J. Lattimar to add Documents navigation in CRM form tab. It was working fine in classical forms, but for unified forms the steps are not working and instead throw exception like An Error as has occurred. Any idea how to get this working?
https://jlattimer.blogspot.com/2017/01/show-sharepoint-documents-on-main-form.html
Xrm.Page is deprecated, so you'll need to update this JS. Start here:
https://learn.microsoft.com/en-us/dynamics365/get-started/whats-new/customer-engagement/important-changes-coming
First of all, this is unsupported approach we are following, author clearly called it out.
In UCI why it broke - someone did investigation already
Replacing Xrm.Page.context.getQueryStringParameters().etc
with "10069" ended up resolving this and currently works within UCI and Classic interfaces.
Actually couple of things to take care.
Like Hoffma said - Xrm.Page is deprecated, you have to rewrite the code to refer formContext from executionContext
Xrm.Page.context.getQueryStringParameters() is not containing the etc now, that's why breaking in UCI. You can supply the entity type code (etc) in the url manually

Export Flash parameters to JavaScript

I'm trying to pass parameters from Flash (as 3.0) to JavaScript.
Tried all methods I found in via. Google, as:
ExternalInterface.addCallback ("fonts", recieveFromJS);
Always one and the same problem; when I try to call the fonts () swfobject, JavaScript gives the error that the method doesn't exist.
Assuming your javascript code does not have a syntax error somewhere, this usually happens because of jquery (or some other js bundle) is stepping on your code. Try using a test page with just the javascript you need, removing all other code and header entries. If it works, then add scripts and links back, one at a time, and you will find which code is breaking it. If it does not work even in your test page, then you have a code/syntax/logic problem with the snippet of code you are working with. If you still have a problem with a code snippet, post it here and I or someone will surely help debug it for you.

Programatically retrieve count of javascript errors on page

I'd like to write a test case (using Selenium, but not the point of this question) to validate that my web application has no script errors\warnings or unhanded exceptions at certain points in time (like after initializing a major library).
This information can easily be seen in the debug consoles of most browsers. Is it possible to execute a javascript statement to get this information programatically?
It's okay if it's different for each browser, I can deal with that.
not so far read about your issue (as far as I understood your problem) here
The idea be the following:
I found, however, that I was often getting JavaScript errors when the page first loaded (because I was working on the JS and was introducing errors), so I was looking for a quick way to add an assert to my test to check whether any JS errors occurred. After some Googling I came to the conclusion that there is nothing built into Selenium to support this, but there are a number of hacks that can be used to accomplish it. I'm going to describe one of them here. Let me state again, for the record, that this is pretty hacky. I'd love to hear from others who may have better solutions.
I simply add a script to my page that will catch any JS errors by intercepting the window.onerror event:
<script type="text/javascript">
window.onerror=function(msg){
$("body").attr("JSError",msg);
}
</script>
This will cause an attribute called JSError with a value corresponding to the JavaScript error message to be added to the body tag of my document if a JavaScript error occurs. Note that I'm using jQuery to do this, so this specific example won't work if jQuery fails to load. Then, in my Selenium test, I just use the command assertElementNotPresent with a target of //body[#JSError]. Now, if any JavaScript errors occur on the page my test will fail and I'll know I have to address them first. If, for some strange reason, I want to check for a particular JavaScript error, I could use the assertElementPresent command with a target of //body[#JSError='the error message'].
Hope this fresh idea helps you :)
try {
//code
} catch(exception) {
//send ajax request: exception.message, exception.stack, etc.
}
More info - MDN Documentation

Categories