I'm struggeling with a function of mine and I dont' quite know why, as this method seems to have worked so far for other functions. Basically I'm getting Objects from a SharePoint List and return all the Values in common. Somehow in my returned variable my "Result" is always undefined. When I make a breakpoint at the deferred.resolve() result is correctly defined but somehow it doesnt get out. Maybe someone has an idea where I'm doing it wrong.
I also tried the resolve in a seperate chained done. Still the same behaviour though :(
I'm currently working on something to enable me to beta test some functions without changing the html file and still leave everything running normal for the user. To do this I'm doing the following. I'm stroring a beta-variable in the localStorage and when it is set to true i want to load the scripts from another location. That works perfectly well but since i want to do this with some more scripts now, i want to load all scripts first, then do a callback. So far it looks like this
Script run directly from the html-Document
function documentCustomReady(){
var commonsPath;
if(localStorage.getItem('testBeta')==='true'){
commonsPath = 'somePath/_BETA/commons/';
}else{
commonsPath = 'somePath/commons/';
}
$.getMultipleScripts([
specificPath + 'lopGgi.js',
],{
Callback: function(){lopGgi.initCreateForm();}
});
}
And this is how I try to extend jQuery to enable it to get multiple Scripts
$.extend({
getMultipleScripts: function(Scripts, Settings){
$.when(
$(Scripts).each(function(){
$.getScript(this.toString());
}),
$.Deferred(function(deferred){
$(deferred.resolve);
})
).done(function(){
Settings.Callback();
});
}
});
Sadly that doesn't work, as i always geht the error, that my functions I defined in the scripts to be loaded are not defined. The scripts get loaded though, it just seams the Callback is not able to access them. The whole when/done function still is a pretty big mistery to me but maybe you could help me out
I was wondering if maybe you can help me. I'm still no real expert on manipulating strings. This is what I'm trying to do. I have a Textbox that has text something like this
XX.XX.XXXX (european date Format)
Some Text to that date
XX.XX.XXXX
Some more text to that second date
I wand to wrap a complete Text in a <details> tag, and the date itsself in a <summary>-Tag. So far so good. I created a pattern and get the indexes of the dates by
var pattern = /\d\d.\d\d.\d\d\d\d/g;
var indeces = [];
$(text.match(pattern)).each(function(index){
indecex[index] = date.indexOf(this);
});
Now i can insert the Tags I want. So far so good. But how can I ensure it only adds the tags if not already added. Is there a not-selector or something similar in a regular expression as well? Would be thankful for help. Thanks in advance and
I have to admit I haven't worked with draggable content so far and maybe I'm doing something very basic wrong here but all my research so far didn't give me an answer. I'd be greatful for some help.
I'm pretty sure this question has been asked before but I couldnt find anything even though I tried alot of different descriptions for my problem. So this is what I do. I have a js-File that basically looks like this
abc = function(){
var initialStartTime = new Date();
return{ init: function(){ currentAgenda = ...//something from localStorage
initialStartTime = new Date(currentAgenda[0].startTime) }, updateAgenda: function(){ currentStartTime = initialStartTime; currentStartTime = new Date(some new Date);
} }
I want my initialStartTime to be set one time in the init-Function. However if I change the currentStartTime it always also changes my initialStartTime
Any ideas how i can prevent that from happening? Thanks alot in advance
i have a little problem I can't really solve. I have a given website where I want to color dates that are overdue by a red font color. The problem is this. The date is implemented in a DD.MM.YYYY format in a title attribute of a span tag.
Is there a possibility to get back all elemets that contain a title with the format "XX.XX.20XX" where the X has to be a number? Thanks in advance for your help and
i found topics on this matter before but nothing seems to do the
trick with my problem. It's acually quite simple. I have a table.
By clicking on the row i want this to fire
It returns that the Propagation is stopped. Now when I click a
child-div in the row, i want this function to go off
$('.cclHeaderProgPic').click(function(evt){
evt.preventDefault();
console.log('Pressed currend Status');
});
For some reason, the child click, never gets triggered. I always
just get the parents function to fire. And when I inspect the element
in the browser (chrome and ie as well) it only lists the
parent-function under event-listeners. It would be great if anyone had
an idea what I'm doing wrong. Thanks in advance and
I'm pretty new and I hope this hasn't been asked yet, but I
was not able to find an answer to my question neither via googeling
nor in this forum. I have this problem. I have a string consisting of
points and numbers
For example
stringXy
= "1.2.1-TaskXY"
What i wand to do is just to get the number part and replace all
the dots by underscores. Im trying
stringXy.trim().replace(/./g,'_').substr(0,5);
However I just get the result "_____". I hope someone
has an answer for me. Thanks in advance and