|
|
Those products are called IDEs (as Richard pointed), we do not use notepads, as they require us to shift our attention from editor to compiler, to runtime, to some terminal or program to show results. Use Visual Studio Code[^], it is above than Notepad, less powerful than Visual Studio, but supports web development of any platform.
For an in-depth, see Language Support in Visual Studio Code[^].
If you need something big, use Visual Studio Community.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
|
I'm having trouble getting my ddl to show items from my stored procedure.
Here's the View
@(Html.Kendo().DropDownList()
.Name("ddDrivers")
.DataTextField("DriverID")
.DataValueField("Arm_ID")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("DriverInfo", "Agent");
});
})
) <br />
Controller: "AgentController"
public ActionResult DriverInfo([DataSourceRequest]DataSourceRequest request)
{
using (var CB = new CBEntities())
{
var result = CB.GetDriverInfo("U00250").ToList();
return Json(result.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
}
}
What am I doing wrong here? Thanks!
|
|
|
|
|
And the problem is? How do we know what went wrong...
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
The data wasn't showing in the dropdown! I already stated the problem!!
But, never mind because I fixed it on my own by manually building a list before sending it to the view;
public JsonResult GetDriverList()
{
var x = (from n in cb.GetDriverInfomation("U00250") select n);
List<string> items = new List<string>();
foreach (var item in x)
{
items.Add(item.ToString());
}
return Json(items.ToList(), JsonRequestBehavior.AllowGet);
}
modified 20-Dec-16 10:29am.
|
|
|
|
|
Given any arbitrary image, I want to crop from the center of the image and display it ,when page is responsive,using media queries.
|
|
|
|
|
Instead of that, how about you just assign that as a background image to your HTML control and let browser do the hard part for you?
background-image:url('../images/bg.png');
background-repeat:no-repeat;
background-size:contain;
background-position:center;
More here, Responsive css background images - Stack Overflow[^]
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Hi, I am pretty new in php , how can I send email with php?
|
|
|
|
|
Just type your question into Google.
|
|
|
|
|
Yes very simple in PHP, just read the doc :
The mail function returns boolean.
bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )
|
|
|
|
|
Why are you telling this to me?
|
|
|
|
|
I have just configured my local Tomcat to support https in order to test Firebase messaging on my web app. I am able to get to my app now via https - however, when Firebase tries to load I get a bunch of errors indicating that there are too many redirects going on for Firebase. The only redirect is whatever is being done to allow https.
Is there a way to get Tomcat to handle https without incurring redirects in the process?
|
|
|
|
|
You need to recheck the settings on Firebase, perhaps the URLs that you gave are looping over each other. Check them in the dashboard.
Firebase Authentication | Firebase[^]
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I am using VS2015 Update 3 with Typescript 2 for VS installed. I have a simple ASP.NET Core MVC web application with a few very simple typescript files. In the root of my project I have a tsconfig.json file with "compileOnSave": true.
I have 4 versions (1.0, 1.7, 1.8 and 2.0) of Typescript installed on my PC in directory: C:\Program Files (x86)\Microsoft SDKs\TypeScript
If I save a typescript file then it is correctly compiled to a javascript file of the same name. If I then remove any generated javascript files and perform a build of the project then again the typescript files are correctly compiled to javascript files.
If I rename the directory: "C:\Program Files (x86)\Microsoft SDKs\TypeScript" to "C:\Program Files (x86)\Microsoft SDKs\TypeScript.bak" so that the typescript compilers are unavailable, then on project build I get the error:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft.TypeScript.targets(176,5): error MSB6003: The specified task executable "tsc.exe" could not be run. Could not find a part of the path "C:\Program Files (x86)\Microsoft SDKs\TypeScript"
as expected. However, editing and then saving a typescript file still results in compile on save working and the updated javascript file being generated.
Under these circumstances, how is Visual Studio finding the typescript compiler in order to perform the compile on save?
It appears that Visual Studio is using a different mechanism for performing compile on save compared to the mechanism used for compiling typescript during project build. Is this the case? If so, what is that mechanism?
|
|
|
|
|
Hi I'm new to jQuery and would like to clear up a few questions regarding the use of multiple script files on the same web page.
Suppose I have a large jQuery script file and I want to break it up so that I have smaller script files.
Before I break up my large file, everything is done inside of '$(document).ready ()'.
My question is if I take some of the code from the large file and put them in other files, do I need to put them in document ready as well in the new files? Please explain why or why not.
|
|
|
|
|
You should understand why you need $( document ).ready()[^].
Outside of this ready() method, a script has to be placed after those html elements that it seeks to manipulate, try this:
<script>
$("p").css("color", "red")
</script>
<p>What color will I become?</p>
<script>
$("p").css("color", "green")
</script>
It will never become red, as the p tag has not being rendered yet when the first script is read.
So it depends on the context of your script.
If you really want to break the script into several, you can wrap them in separate ready() functions.
Peter Leow
http://www.peterleowblog.com/
https://www.amazon.com/author/peterleow
modified 8-Dec-16 6:58am.
|
|
|
|
|
Hi, thanks for replying. If I understand you correctly, you are saying that I can break up my large jQuery file into smaller ones as long as I put document ready inside of the new files, then put my code from the large file into document ready.
Am I correct?
|
|
|
|
|
Say you have an external js file called external.js that contains this code:
$( document ).ready(function() {
console.log( "script 1!" );
});
$( document ).ready(function() {
console.log( "script 2!" );
});
In your html file, place the link to this external.js after the jquery library like this:
<script src="jquerylibrary.js"></script>
<script src="external.js"></script>
Peter Leow
http://www.peterleowblog.com/
https://www.amazon.com/author/peterleow
|
|
|
|
|
Hi, I guess I'm asking about best practices when breaking up script files into multiple external files.
Suppose I want to do something like below where I only call the functions which reside in other files
$(document).ready(function(){
function1();
function2();
function3();
function4();
function5();
});
The definitions of the functions being called inside of File1 are in other files.
Is this a common practice? If it is not how most people keep their files small,
please suggest how it is done by most people.
|
|
|
|
|
Based on your clarification, a function is a block of code that will only be executed when it is called, as such, there is no need to place a function inside the ready() method. You may put functions into multiple files and link them to your html file.
Peter Leow
http://www.peterleowblog.com/
https://www.amazon.com/author/peterleow
|
|
|
|
|
You're looking for a technology called Asynchronous Module definitions (AMD). In general, breaking down actual required JavaScript into separate files that are loaded into the browser is an anti-pattern, because it creates more overhead and load times. JS files are loaded synchronously by default, so a file must be fully loaded before another is even requested.
A common tactic is to bundle and minify (uglify) multiple files into a single one for performance gain. If you have optional components that may or may not be needed in a specific execution workflow, you can separate that functionality out and call it at runtime with a module loader that uses AMD like requirejs.
Since you're using jQuery, have a look at How to use RequireJS with jQuery[^]
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
I have an app to check for differences between 2 objects. These objects have many attributes that can be changed over the course of time. The user of the application can select which attributes he/she wants to check for differences (for certain objects the user may know that one or 2 of the attributes won't change). In the comparison function, however, there are two attribute (its text and heading) that we automatically check. The output of the function needs to show a table as it looks below:
Original Text | Current Text | Attribute Changes
The problem I have is that since text and heading are attributes of the objects, they always appear in the list. When I get to the Attribute Changes column, I want to just loop through the list, but ignore the Text and Heading attributes. What is the easiest way to do this? Do I add an if-else statement when looping, or is there another way to do this?
Chris
|
|
|
|
|
Christopher Cote wrote: Do I add an if-else statement That's the usual way to alter the path through some code.
|
|
|
|
|
Hi Guys,
I am trying to display an html page inside an iframe, specifically for browsers on Android. So far I have been using the built in browser and chrome.
The challenge is that I want the entire content to be displayed. Currently, it "overflows" the iFrame so the user must scroll horizontally to read the contents. I can manipulate the content html as it is generated by me in the same ASP.Net app. The src attribute of the iFrame is set server side.
Things I have tried so far:
•Zooming, scaling the iFrame: Changes the iFrame size not the content
•Zooming, scaling the and tags inside the content html: This works, but when the user switches between portrait and landscape, the content doesn't scale according to the changed size of the iFrame.
•Everything on stackoverflow that I could find.
•Whatever I could find on other sites.
Here is the Page's code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="***.aspx.cs" Inherits="***.***" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sign Document</title>
<link href="Content/bootstrap.css" rel="stylesheet" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
</head>
<body>
<form runat="server" class="form-horizontal">
<div class="container body-content">
<div class="form">
</div>
<div class="row">
<div class="col-md-10">
<h2 class="text-center">Please Read</h2>
<p class="text-center">The document you are about to sign is displayed below. Please read it carefully before tapping the Sign Now button.</p>
</div>
</div>
<div class="row">
<div class="col-md-10 text-center">
<hr />
</div>
</div>
<div class="row">
<div class="col-md-10 text-center">
<div class="embed-responsive img-rounded embed-responsive-16by9" style="border: 2px solid darkgray; -webkit-overflow-scrolling:touch; overflow:auto;">
<iframe id="MediaDisplayIFrame" runat="server"></iframe>
</div>
</div>
</div>
<div class="form">
</div>
<div class="row form-group">
<div class="col-md-10 text-center">
<asp:Button class="btn btn-default form-control" ID="SignButton" runat="server" OnClick="SignButton_Click" Text="Sign Now" />
</div>
</div>
</div>
</form>
</body>
</html>
|
|
|
|