|
Thank You, Wombaticus! I corrected the spelling, but I am afraid I am not sure how to follow your second instruction? How do I do that in the code, please?
|
|
|
|
|
Browser.msgBox('Welcome to my spreadsheet '+myvar[0], Browser.Buttons.OK);
modified 17-Jan-16 19:09pm.
|
|
|
|
|
Wombaticus . .okay so this is what I have . .but I still receive an error . . .
function onOpen() {
var MyName = Session.getActiveUser()
var myvar = MyName.split("@");
Browser.msgBox('Welcome to my spreadsheet '+myvar[0], Browser.Buttons.OK);
}
|
|
|
|
|
Are you sure
Session.getActiveUser() is returning a string (i.e. is not 'undefined')?
Otherwise, I don't know I'm afraid. (And I have to go now - sorry.)
|
|
|
|
|
Try wrapping your code in a try..catch block to catch the error and find out exactly where/what it is.
|
|
|
|
|
Wombaticus - your last message helped me correct it . . .you were right getActiveUser() was not returning a string . . THANKS!!!
var MyName = Session.getActiveUser().getEmail()
|
|
|
|
|
Member 12269518 wrote: but I still receive an error . . .
If you want us to help you fix an error, it would help if you told us what that error is.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi,
I have a google map with dropdown menu contains map and statellite. When we hover on it will show Change map style. How to change to our own text instead of Change map style.
google.maps.MapTypeControlStyle.DROPDOWN_MENU used to show dropdown.
How to achive this. If anybody knows, please reply me.
Thanks in advance.
|
|
|
|
|
How does a multidimensional array works? Is the below code similar?
var people = [
["","","",],
["","","",],
["","","",],
["","","",]
];
|
|
|
|
|
|
Your layout isn't terribly meaningful for illustration. Basically they are indexed from outermost to innermost:
var array = [
['thing1','stuff1'],
['thing2','stuff2'],
['thing3','stuff3'],
]
Will result in:
array[0] === ['thing1','stuff1'];
array[0][0] == 'thing1';
array[0][1] == 'stuff1';
array [2][1] == 'stuff3';
And since strings are arrays:
array[0][0][0] === 't';
array[0][0][1] === 'h';
array[0][0][2] === 'i';
array[0][0][3] === 'n';
array[0][0][4] === 'g';
array[0][0][5] === '1';
And there's your 10 second multi-dimensional array tutorial.
|
|
|
|
|
Hello,
I am trying to make a countdown clock and I want to start with a time (5:00 minutes) and from there press a submit button to start the countdown. I have no idea where to start. I am using javascript to code my countdown clock.
|
|
|
|
|
|
I am looking to achieve the following effect in a mobile browser using HTML and JavaScript.
Firstly, the browser will show a facsimile of a complicated page consisting of sections, columns etc, a bit like, say, the page of a broadsheet newspaper. This facsimile will fit in its entirety on the screen.
From here, I want a single tap on a particular section of the page to zoom in on that section, causing it to fill the entire screen width.
It should then be possible to navigate from one portion of the screen to the other by dragging up/down/left/right.
Does anyone know of any technique/tool/library to achieve this?
I should mention that the paragraphs/columns/etc are identifiable divs.
|
|
|
|
|
Sure, just use the tools in whatever framework you're using (or vanilla) to hide the divs that aren't selected, set the selected to 100%/100%, and to change the selection based on drag direction. Just a couple of event handlers and you're there.
Pick a library, write a treatment, and I'm sure everyone will gladly help from there.
|
|
|
|
|
I want to load all the images from a folder on local by using Jquery/Javascript.
Please help me.
Thanks you!
|
|
|
|
|
Where are you stuck?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I'm new in Javascript web applications, I'm more used to creating java/Spring c#/.Net applications, I'm also not a guru in those, though.
What I always do when I create a web application using MVC pattern I do the following:
I create the following folders to organize my code
-View folder: here I put all the HTML files
-Controller folder: here I put all my methods that call the necessary methods to bring me the data that's needed in the views.
-Service folder: here I put all the methods that go to the database to bring info and other necessary methods from the business logic.
-Model folder: here I put all my classes with the attributes example (User class, Role class, Vehicle class, etc).
Example:
public class User {
private name;
.....
getters and setters...
}
I want to apply the same or a similar concept to my Javascript/AngularJS tutorial learning app
So far I have created a very simple app a calculator app with the Service Layer, Controller Layer and View Layer and they work as I expected to work,
the service layer: have all the methods like add, subtracts, multiply.
the view layer: have the html where I input the numbers.
the controller layer: have the method that calls the service and then I pass the data to the view.
BUT my problem is that I don't know how the Model fits in a AngularJS app I have see that some tutorials put the model objects inside the controllers like this
app.controller('BookController', ['$scope', function($scope) {
$scope.book = {
id: 1,
name: 'Harry Potter',
author: 'J. K. Rowling',
stores: [
{ id: 1, name: 'Barnes & Noble', quantity: 3},
{ id: 2, name: 'Waterstones', quantity: 2},
{ id: 3, name: 'Book Depository', quantity: 5}
]
};
}]);
but I don't know if that's the way because if I need a model object in another controller do I need to declare the same code in the other controller??
Also how should I deal with model objects that have inside other model object lets say Users have roles inside them.
where should I put my model objects like User, Role, Vehicle etc? Is there a good approach if I create a .JS file named model.js and put there all the objects like this:
function Apple (type) {
this.type = type;
this.color = "red";
}
Apple.prototype.getInfo = function() {
return this.color + ' ' + this.type + ' apple';
};
But I have read about the global scopes and bad practices etc I actually don't know too much about that if I create that file model.js with my model objects would I be creating a problem?
I'm very open to suggestions since I'm learning
|
|
|
|
|
There's a problem with terminology that you need to wrap your head around before you can really dig in with Angular. The primary issue is that what Angular calls a controller, most everyone else would call a ViewModel (part of why they advertise it as MV-Whatever). More precisely, the $scope on a specific controller is the model that is bound to the interface.
A better way to think of model generation in angular is to consider the prototype/instance relationship. You don't need to reinvent the wheel (or re-implement an object) every time you fire up a $scope. Instead, you can leverage either the service or factory providers to provide the prototypes. Use a service when you need something that has a state to maintain, and use a factory for new, fresh objects.
what I wouldn't do is use vanilla JS definition and prototyping to define objects. This will put them outside of the normal Angular digest cycle, they will not be registered through a provider, and you might find they do not behave as expected. You'll also be skipping out on Dependency Injection, which would be a shame.
For instance:
myApp.factory('appleFactory',[function(){
return {
new : function(type){
return { type : type, color: 'red' };
}
}
}]);
myApp.controller('getMoreApplesController',['$scope','appleFactory',function($scope, Apple){
$scope.firstApple = Apple.new('Golden Delicious');
$scope.secondApple = Apple.new('Washington Red');
}]);
|
|
|
|
|
Hello all,
I am new at javascript and I just learned how to prompt the user for input. But I was wondering how can I keep the prompt box on the screen so additional information can be entered. Once the information is enter the message appears and then the prompt goes away and I have to refresh to make it pop up again.
Thanks
Candi 
|
|
|
|
|
If you need to take multiple information, I would suggest to have a set of text boxes in a page itself instead.
If you need the prompt only, you need to re call the prompt again in loop for all your needed information.
Life is a computer program and everyone is the programmer of his own life.
|
|
|
|
|
Thank you so much. I was able to figure it out.
|
|
|
|
|
Try this but i not sure is this what u wanted, as it have same as title and the need u described !!
in this site on Prompt Box http://www.w3schools.com/js/js_popup.asp
|
|
|
|
|
Thank you so much. I figured it out.
|
|
|
|
|
No, You can't do this. As prompt() is the in built function of JavaScript. So, you can't modify that.
But you can make your own dialogue box not prompt.
|
|
|
|
|