Skip to content

ErcanOPAK.com

  • ASP.Net WebForms
  • ASP.Net MVC
  • C#
  • SQL
  • MySQL
  • PHP
  • Devexpress
  • Reportviewer
  • About

Category: JavaScript

JavaScript

How to auto-scroll or manually to end of div when data is added

- 15.01.21 - ErcanOPAK comment on How to auto-scroll or manually to end of div when data is added

Auto-Scroll (every 5 seconds) window.setInterval(function() { var element = document.getElementById(“myDiv”); element.scrollTop = element.scrollHeight; }, 5000);

Read More
JavaScript

How to use toFixed() for Float numbers in Javascript

- 21.11.20 | 15.01.21 - ErcanOPAK comment on How to use toFixed() for Float numbers in Javascript

The toFixed() method formats a number using fixed-point notation. function financial(x) { return Number.parseFloat(x).toFixed(2); } console.log(financial(123.456)); // expected output: “123.46” console.log(financial(0.004)); // expected output: “0.00” console.log(financial(‘1.23e+5’)); // expected output: “123000.00” OUTPUT: > “123.46” > “0.00” > “123000.00”

Read More
ASP.Net MVC / ASP.Net WebForms / JavaScript

How to use column search in datatable when responsive is false

- 18.09.20 - ErcanOPAK comment on How to use column search in datatable when responsive is false

just add “$(“th”).show();” in the end of initComplete … , initComplete: function () { … $(“th”).show(); } , …  

Read More
JavaScript

New line in JavaScript alert box

- 19.08.20 | 19.08.20 - ErcanOPAK comment on New line in JavaScript alert box

If you use with C# then \n will put a new line alert(“some text\nmore text in a new line”);

Read More
ASP.Net MVC / ASP.Net WebForms / JavaScript

How to refresh a DIV content with Javascript

- 23.07.20 - ErcanOPAK comment on How to refresh a DIV content with Javascript

To reload a section of the page, you could use jquerys load with the current url and specify the fragment you need, which would be the same element that load is called on, in our below case #myDivId function updateDivContent() { $(“#myDivId”).load(window.location.href + ” #myDivId” ); }

Read More
ASP.Net MVC / ASP.Net WebForms / C# / JavaScript

Passing parameters to JavaScript files

- 25.06.20 | 25.06.20 - ErcanOPAK comment on Passing parameters to JavaScript files

You can assign an id to the <script> element and passing the arguments as data-* attributes. The resulting <script> tag would look something like this:

Read More
ASP.Net MVC / JavaScript

How to solve ajax.reload() not working for DataTables in JS File

- 22.06.20 | 22.06.20 - ErcanOPAK comment on How to solve ajax.reload() not working for DataTables in JS File

If you use the reload in this way then it will probably not work. table.ajax.reload();

Read More
ASP.Net WebForms / HTML / JavaScript

Javascript Refresh and CountDown Timer

- 22.11.19 | 22.11.19 - ErcanOPAK comment on Javascript Refresh and CountDown Timer

<script type=”text/javascript”> function checklength(i) { ‘use strict’; if (i < 10) { i = “0” + i; } return i; } var minutes, seconds, count, counter, timer; count = 301; //seconds counter = setInterval(timer, 1000); function timer() { ‘use strict’; count = count – 1; minutes = checklength(Math.floor(count / 60)); seconds = checklength(count – minutes […]

Read More
JavaScript

How to Auto-Refresh Page with Javascript

- 22.11.19 | 22.11.19 - ErcanOPAK comment on How to Auto-Refresh Page with Javascript

<script type=”text/javascript”> function timedRefresh(timeoutPeriod) { setTimeout(“location.reload(true);”, timeoutPeriod); } window.onload = timedRefresh(300000); </script> Reference

Read More
ASP.Net WebForms / HTML / JavaScript

Get and Use TextBox Values with Javascript

- 04.06.18 | 22.11.19 - ErcanOPAK comment on Get and Use TextBox Values with Javascript

Here is the example code to get and use TextBox Values with Javascript:

Read More
Page 2 of 2
« Previous 1 2

Posts navigation

Newer posts
October 2024
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  
« Sep    

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (848)
  • Get the First and Last Word from a String or Sentence in SQL (756)
  • How to select distinct rows in a datatable in C# (704)
  • How to add default value for Entity Framework migrations for DateTime and Bool (584)
  • Add Constraint to SQL Table to ensure email contains @ (521)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (481)
  • How to make theater mode the default for Youtube (467)
  • Average of all values in a column that are not zero in SQL (453)
  • Find numbers with more than two decimal places in SQL (383)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (371)

Recent Posts

  • How to Reset Taskbar in Windows 11
  • Essential Steps to Take After Windows 11 Updates
  • How to list all tables referencing a table by Foreign Key in MS SQL
  • How to format date in Javascript
  • How to generate a random number for each row in T-SQL
  • How to solve ‘Microsoft.TeamFoundation.Git.Contracts.GitCheckoutConflictException’ problem
  • Why nautical mile equals 1852 mt
  • How to Find Day Name From Date in SQL Server
  • How to make pagination in MS SQL Server
  • How to update Identity Column in SQL Server

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (848)
  • Get the First and Last Word from a String or Sentence in SQL (756)
  • How to select distinct rows in a datatable in C# (704)
  • How to add default value for Entity Framework migrations for DateTime and Bool (584)
  • Add Constraint to SQL Table to ensure email contains @ (521)

Recent Posts

  • How to Reset Taskbar in Windows 11
  • Essential Steps to Take After Windows 11 Updates
  • How to list all tables referencing a table by Foreign Key in MS SQL
  • How to format date in Javascript
  • How to generate a random number for each row in T-SQL

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter

© 2024 ErcanOPAK.com

Proudly powered by WordPress | Theme: Xblog Plus by wpthemespace.com