Im having a problem with oembed outputting an error in firebug's console windows as such:
oembed is null
oembedContainer.html(oembed.code);
which is when clicked will point to the jquery.oembed.js file.
my declaration of oembed is that it will replace all links with a class name of oembed, like so:
$(".oembed").oembed(null, {
embedMethod: "replace",
maxWidth: 350,
maxHeight: 350,
vimeo: { autoplay: false, maxWidth: 350, maxHeight: 350 }
});
i think the error is pointing on the first parameter of the function oembed().
but i really dont know what is happening inside, do somebody know a workaround here??
This is the link where I got the code:
http://code.google.com/p/jquery-oembed/
I had the same problem until I noticed the snippet had a non absolute url for loading the script. Therefore it never loaded at all. Change this:
<script type="text/javascript" src="../../jquery.oembed.js"></script>
For the actual url of your script, for example, if you're testing it local and both the html test page and the script are in the same folder:
<script type="text/javascript" src="jquery.oembed.min.js"></script>
That will do the trick.
Related
I have 2 .NET web pages that have the same popup box in both pages The JavaScript is exactly the same in both pages, I copied the code from the page that works to the other page and it doesn't work. the one that doesn't work gives me the error message:
Scripts/jquery-3.3.1.js
0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'dialog'.
I have tried putting the code at the end of the page, no difference. Best I can tell jquery is being load into the page in the header when I check the page with the IE developer. Hope someone can point me in the right direction.
<link href="Content/themes/base/jquery-ui.css" rel="stylesheet" />
<link href ="~/Styles/Default.css" rel="stylesheet" />
<script src="../Scripts/jquery-3.3.1.js"></script>
<script src="../Scripts/jquery-ui-1.12.1.js"></script>
<script>
$(document).ready(function() {
$("#dd2875").dialog({
buttons: {
"Cancel": function() {
$("#dd2875").dialog('close');
}
},
dialogClass: 'myTitleClass',
draggable: false,
width: 800,
height: 400,
hide: 2000,
show: 'slidedown',
hide: 'explode',
autoOpen: false
});
$("#btnNewAccount").click(function(evt) {
evt.preventDefault();
$("#dd2875").dialog('open');
});
});
</script>
The DOM probably does not contain an element with the ID dd2875,
Verify that #dd2875 actually exists on the page at the point that you are calling dialog()
I entered the code you sent and this is what I got back in the console.
jQuery.Deferred exception: Object doesn't support property or method dialog' TypeError: Object doesn't support property or method 'dialog'
at Anonymous function (http://localhost:60086/Add_CAC_ID.aspx:14:13)
at mightThrow (http://localhost:60086/Scripts/jquery-3.3.1.js:3534:10)
at Anonymous function (http://localhost:60086/Scripts/jquery-3.3.1.js:3602:12) undefined
I figured it out, had to go back and rewrite the page one section at a time to do it. The problem was a conflict between the JavaScript and the asp validation controls. When I put the control on the page it caused the error with the dialog. I found two solutions to the conflict. I could add the first line in the page load or the second line in the JavaScript either one worked. Thanks for the help in getting me pointed in the right direction.
Unobtrusivevalidaionmode = Unobtrusivevalidaionmode .none
or
$j = $.noConflict;
i need help implanting my jquery script in wordpress.
I already linked everything in function.php (wp_enquere_scripts) and i checked it, both js load.
Now i have a problem not displaying what i would like to and I have no idea why...is it possible that my source-link is wrong?
here the code (its a 3d model viewer with images)
<div class="wpb_wrapper">
<script type="text/javascript"> $('.wpb_wrapper').spritespin({
source: SpriteSpin.sourceArray('/img/rad_zoom_{frame}.jpg', { frame: [1,34], digits: 3}),
width: 1100,
height: 770,
sense: -1,
mods: ['move', 'zoom', '360'],
autostart: false,
behavior: null,
module: null
});
here the link of the official plugin:
http://www.jqueryscript.net/other/Versatile-jQuery-Product-Image-Viewer-Plugin-SpriteSpin.html
maybe you guys know a better way putting this onto a wordpress-site
thanks
I'm getting the following error in my console:
Uncaught TypeError: Cannot read property 'length' of undefined galleria-1.4.2.min.js:2
trying to use Galleria.io, version 1.4.2 with the basic "classic theme". I do have jQuery (v1.10.2) included and the following code which should be the basic code for getting the galleria image gallery to work:
<script src="galleria/galleria-1.4.2.min.js"></script>
<script>
Galleria.loadTheme('/galleria/themes/classic/galleria.classic.min.js');
Galleria.run('.galleria', {responsive: true, height: 0.724, lightbox: true});
</script>
and guess what, it seems to work perfectly. BUT, I'm having this error in my console and I'm not allowed to have errors in my console. Neither do I like error messages in my console...
I have no clue what is causing this and what I can do about it, all I know it's triggered by the following line:
Galleria.run('.galleria', {responsive: true, height: 0.724, lightbox: true});
Even if I would leave the options blank. I'm also using bootstrap v3 if that might have anything to do with it.
The selector is a class and not an ID, but I've seen it in example code so it souldn't be a problem. I have multiple small image galleries on one page, so 0, 1 or more so working with ID's is not a good option. My application does require this.
Thanks in advance for helping.
Hello fellow Galleria User. Your problem is
Galleria.loadTheme('/galleria/themes/classic/galleria.classic.min.js');
You have to ensure its loaded before
Galleria.run('.galleria', {responsive: true, height: 0.724, lightbox: true});
is called.
To do so, I loaded the Theme in the Header after the Galleria.js.
I invoke the Galleria.run Command in a script-tag after the Galleria Container containing the Pictures.
Using Telerik controls version 2012.1.214.340 with mvc 3. I want to open a modal window to an external page and thought it would be straight forward....but either it is not...or more likely I am not googling / reading the correct documentation.
I don't really want to load the content into a hidden div and then pop it modal later if the user chooses to do so.
I would prefer to just do it all in javascript / jquery and so my research led me to write this:
What I wrote thus far in javascript is:
var windowElement = $.telerik.window.create({
title: "Test Modal",
html: "<strong>Where am I</strong>",
contentUrl: 'http://www.google.com',
modal: true,
resizable: false,
draggable: true,
scrollable: false,
onClose: function () { }
});
cshtml razor is:
#(Html.Telerik().ScriptRegistrar()
.jQuery(false)
.jQueryValidation(false)
.DefaultGroup(grp => grp
.Add("telerik.window.min.js")
))
)
When I run the site I get this error on load of the page:
0x800a138f - JavaScript runtime error: Unable to get property 'scripts' of undefined or null reference
and the debugger is on this line in the telerik.window.min.js
b.scripts.push("telerik.window.js")
Based upon the line it broke on I went looking for telerik.window.js and didn't find it in the project...huh? The previous owner didn't include that one file?
So I went to google code and found this.
Created the file and added it as such and still I get the error...
So I think I am missing something else but not sure exactly what.
TIA
You shouldn't have to manually include a telerik JS file, they should be loaded automatically (as long as they are in a correct folder).Do you have a folder /Scripts/2012.1.214 with a lot of telerik.js file + jquery ?
Can you try again without adding that file to the DefaultGroup ?
But you'll have another problem, as I see you declare jQuery(false). Was it done on purpose ? Because if you set it to false, and don't declare another jQuery file in the DefaultGroup, nothing will work.
I had the same problem, doing this worked for me:
#(Html.Telerik().Window()
.Name("_placeholder")
.Visible(false)
)
Including somewhere on the page a static window that will never be used - telerik seems to only include scripts when an control of that type is used.
If some body can answer.
<script type="text/javascript">
$(document).ready(function(){
//alert("Before..");
$('#myGallery').galleryView({
panel_width: 960,
panel_height: 424,
frame_width: 160,
frame_height: 70,
panel_scale: "nocrop",
frame_opacity: 0.6,
pause_on_hover: true
});
//alert("AFter....");
$('#homeGallery').innerfade({
speed:900,
timeout: 8000
});
});
</script>
above is the code it is not working
if I remove the alert("before.") it will work.
This could be an issue with some required parts of the document not having been loaded yet. After you have dismissed the dialog, they have and the code works.
Have you tried using document.load instead of document.ready?
I have run into similar issues before and it always suggests a race condition. Although you should be fine because you have a document.ready... to test this, try putting that call into a setTimeout( function(), 1000) and let me know what happens
Can you trying clearing your browser cache. If that doesn't work can you provide the HTML schema